[#llvm-CallbackVH] = xref:llvm.adoc[llvm]::CallbackVH :relfileprefix: ../ :mrdocs: Value handle with callbacks on RAUW and destruction. == Synopsis Declared in `<llvm/IR/ValueHandle.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class CallbackVH : public xref:llvm/ValueHandleBase.adoc[ValueHandleBase] ---- == Description 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. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:llvm/ValueHandleBase.adoc[ValueHandleBase]` | Befriended by DenseMapBase so it can use bucket‐relocation erase callbacks. ValueHandleBase is the only caller that caches pointers into bucket arrays. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/CallbackVH/2constructor-02.adoc[`CallbackVH`] [.small]#[constructor]# | Constructors | xref:llvm/ValueHandleBase/operator_assign-0b.adoc[`operator=`] | Assignment operators | xref:llvm/CallbackVH/allUsesReplacedWith.adoc[`allUsesReplacedWith`] [.small]#[virtual]# | Callback for Value RAUW. | xref:llvm/CallbackVH/deleted.adoc[`deleted`] [.small]#[virtual]# | Callback for Value destruction. | xref:llvm/ValueHandleBase/operator_star.adoc[`operator*`] | Return a reference to the tracked Value. | xref:llvm/ValueHandleBase/operator_ptr.adoc[`operator‐>`] | Return a pointer to the tracked Value. | xref:llvm/CallbackVH/2conversion.adoc[`operator Value*`] | Implicit conversion to the tracked Value pointer. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/ValueHandleBase/ValueIsDeleted.adoc[`ValueIsDeleted`] | Notify all handles that `V` is being destroyed. | xref:llvm/ValueHandleBase/ValueIsRAUWd.adoc[`ValueIsRAUWd`] | Notify all handles that `Old` is being RAUW'd to `New.` |=== == Protected Enums [cols="1,4"] |=== | Name| Description | xref:llvm/ValueHandleBase/HandleBaseKind.adoc[`HandleBaseKind`] | This indicates what sub class the handle actually is. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/CallbackVH/2constructor-05.adoc[`CallbackVH`] [.small]#[constructor]# | Copy‐construct a callback handle from `RHS.` | xref:llvm/CallbackVH/2destructor.adoc[`~CallbackVH`] [.small]#[destructor]# | Destroy the callback handle. | xref:llvm/CallbackVH/operator_assign.adoc[`operator=`] | Copy‐assign from another callback handle. | xref:llvm/ValueHandleBase/RemoveFromUseList.adoc[`RemoveFromUseList`] | Remove this ValueHandle from its current use list. | xref:llvm/ValueHandleBase/clearValPtr.adoc[`clearValPtr`] | Clear the underlying pointer without clearing the use list. | xref:llvm/ValueHandleBase/getValPtr.adoc[`getValPtr`] | Return the raw Value pointer held by this handle. | xref:llvm/CallbackVH/setValPtr.adoc[`setValPtr`] | Point this handle at `P.` |=== == Protected Static Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/ValueHandleBase/isValid.adoc[`isValid`] | Return true if `V` is a non‐null Value pointer. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:llvm/PreservedCFGCheckerInstrumentation/BBGuard.adoc[`BBGuard`] | Sticky poison flag for a basic block once it has been deleted or RAUWed. | xref:llvm/IVStrideUse.adoc[`IVStrideUse`] | Tracks one use of a strided induction variable. | xref:llvm/ValueMapCallbackVH.adoc[`ValueMapCallbackVH`] | CallbackVH that updates its ValueMap when the contained Value changes. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#