LLVM API Documentation

Public Member Functions | Protected Member Functions
llvm::CallbackVH Class Reference

#include <ValueHandle.h>

Inheritance diagram for llvm::CallbackVH:
Inheritance graph
[legend]
Collaboration diagram for llvm::CallbackVH:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CallbackVH ()
 CallbackVH (Value *P)
 operator Value * () const
virtual void deleted ()
virtual void allUsesReplacedWith (Value *)

Protected Member Functions

 CallbackVH (const CallbackVH &RHS)
virtual ~CallbackVH ()
void setValPtr (Value *P)

Detailed Description

CallbackVH - This is a value handle that allows subclasses to define callbacks that run when the underlying Value has RAUW called on it or is destroyed. This class can be used as the key of a map, as long as the user takes it out of the map before calling setValPtr() (since the map has to rearrange itself when the pointer changes). Unlike ValueHandleBase, this class has a vtable and a virtual destructor.

Definition at line 350 of file ValueHandle.h.


Constructor & Destructor Documentation

llvm::CallbackVH::CallbackVH ( const CallbackVH RHS) [inline, protected]

Definition at line 353 of file ValueHandle.h.

virtual llvm::CallbackVH::~CallbackVH ( ) [inline, protected, virtual]

Definition at line 356 of file ValueHandle.h.

Definition at line 363 of file ValueHandle.h.

Definition at line 364 of file ValueHandle.h.


Member Function Documentation

virtual void llvm::CallbackVH::allUsesReplacedWith ( Value ) [inline, virtual]

Called when this->getValPtr()->replaceAllUsesWith(new_value) is called, _before_ any of the uses have actually been replaced. If WeakVH were implemented as a CallbackVH, it would use this method to call setValPtr(new_value). AssertingVH would do nothing in this method.

Reimplemented in llvm::DebugRecVH, llvm::ValueMapCallbackVH< KeyT, ValueT, Config >, llvm::MDNodeOperand, and llvm::MMIAddrLabelMapCallbackPtr.

Definition at line 384 of file ValueHandle.h.

virtual void llvm::CallbackVH::deleted ( ) [inline, virtual]

Called when this->getValPtr() is destroyed, inside ~Value(), so you may call any non-virtual Value method on getValPtr(), but no subclass methods. If WeakVH were implemented as a CallbackVH, it would use this method to call setValPtr(NULL). AssertingVH would use this method to cause an assertion failure.

All implementations must remove the reference from this object to the Value that's being destroyed.

Reimplemented in llvm::DebugRecVH, llvm::ValueMapCallbackVH< KeyT, ValueT, Config >, llvm::MDNodeOperand, and llvm::MMIAddrLabelMapCallbackPtr.

Definition at line 378 of file ValueHandle.h.

References setValPtr().

llvm::CallbackVH::operator Value * ( ) const [inline]

Definition at line 366 of file ValueHandle.h.

References llvm::ValueHandleBase::getValPtr().

void llvm::CallbackVH::setValPtr ( Value P) [inline, protected]

The documentation for this class was generated from the following files: