LLVM  8.0.1
Public Member Functions | Protected Member Functions | List of all members
llvm::CallbackVH Class Reference

Value handle with callbacks on RAUW and destruction. More...

#include "llvm/IR/ValueHandle.h"

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

Public Member Functions

 CallbackVH ()
 
 CallbackVH (Value *P)
 
 operator Value * () const
 
virtual void deleted ()
 Callback for Value destruction. More...
 
virtual void allUsesReplacedWith (Value *)
 Callback for Value RAUW. More...
 
- Public Member Functions inherited from llvm::ValueHandleBase
 ValueHandleBase (HandleBaseKind Kind)
 
 ValueHandleBase (HandleBaseKind Kind, Value *V)
 
 ~ValueHandleBase ()
 
Valueoperator= (Value *RHS)
 
Valueoperator= (const ValueHandleBase &RHS)
 
Valueoperator-> () const
 
Valueoperator* () const
 

Protected Member Functions

 ~CallbackVH ()=default
 
 CallbackVH (const CallbackVH &)=default
 
CallbackVHoperator= (const CallbackVH &)=default
 
void setValPtr (Value *P)
 
- Protected Member Functions inherited from llvm::ValueHandleBase
 ValueHandleBase (const ValueHandleBase &RHS)
 
 ValueHandleBase (HandleBaseKind Kind, const ValueHandleBase &RHS)
 
ValuegetValPtr () const
 
void RemoveFromUseList ()
 Remove this ValueHandle from its current use list. More...
 
void clearValPtr ()
 Clear the underlying pointer without clearing the use list. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::ValueHandleBase
static void ValueIsDeleted (Value *V)
 
static void ValueIsRAUWd (Value *Old, Value *New)
 
- Protected Types inherited from llvm::ValueHandleBase
enum  HandleBaseKind { Assert, Callback, Weak, WeakTracking }
 This indicates what sub class the handle actually is. More...
 
- Static Protected Member Functions inherited from llvm::ValueHandleBase
static bool isValid (Value *V)
 

Detailed Description

Value handle with callbacks on RAUW and destruction.

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.

Definition at line 389 of file ValueHandle.h.

Constructor & Destructor Documentation

◆ ~CallbackVH()

llvm::CallbackVH::~CallbackVH ( )
protecteddefault

◆ CallbackVH() [1/3]

llvm::CallbackVH::CallbackVH ( const CallbackVH )
protecteddefault

◆ CallbackVH() [2/3]

llvm::CallbackVH::CallbackVH ( )
inline

Definition at line 401 of file ValueHandle.h.

◆ CallbackVH() [3/3]

llvm::CallbackVH::CallbackVH ( Value P)
inline

Definition at line 402 of file ValueHandle.h.

Member Function Documentation

◆ allUsesReplacedWith()

virtual void llvm::CallbackVH::allUsesReplacedWith ( Value )
inlinevirtual

Callback for Value RAUW.

Called when this->getValPtr()->replaceAllUsesWith(new_value) is called, before any of the uses have actually been replaced. If WeakTrackingVH 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::ValueMapCallbackVH< KeyT, ValueT, Config >, llvm::MMIAddrLabelMapCallbackPtr, and llvm::cflaa::FunctionHandle< AAResult >.

Definition at line 428 of file ValueHandle.h.

◆ deleted()

virtual void llvm::CallbackVH::deleted ( )
inlinevirtual

Callback for Value destruction.

Called when this->getValPtr() is destroyed, inside ~Value(), so you may call any non-virtual Value method on getValPtr(), but no subclass methods. If WeakTrackingVH 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::ValueMapCallbackVH< KeyT, ValueT, Config >, llvm::MMIAddrLabelMapCallbackPtr, and llvm::cflaa::FunctionHandle< AAResult >.

Definition at line 419 of file ValueHandle.h.

Referenced by llvm::DomTreeUpdater::hasPendingDeletedBB().

◆ operator Value *()

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

Definition at line 404 of file ValueHandle.h.

References llvm::ValueHandleBase::getValPtr().

◆ operator=()

CallbackVH& llvm::CallbackVH::operator= ( const CallbackVH )
protecteddefault

◆ setValPtr()

void llvm::CallbackVH::setValPtr ( Value P)
inlineprotected

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