Value handle that tracks a Value across RAUW.

Synopsis

Declared in <llvm/IR/ValueHandle.h>

template<typename ValueTy>
class TrackingVH;

Description

TrackingVH is designed for situations where a client needs to hold a handle to a Value (or subclass) across some operations which may move that value, but should never destroy it or replace it with some unacceptable type.

It is an error to attempt to replace a value with one of a type which is incompatible with any of its outstanding TrackingVHs.

It is an error to read from a TrackingVH that does not point to a valid value. A TrackingVH is said to not point to a valid value if either it hasn't yet been assigned a value yet or because the value it was tracking has since been deleted.

Assigning a value to a TrackingVH is always allowed, even if said TrackingVH no longer points to a valid value.

Member Functions

Name

Description

TrackingVH [constructor]

Constructors

operator=

Assign this handle to point to RHS.

getValPtr

Return the tracked typed Value, asserting it is alive and correctly typed.

operator*

Return a reference to the tracked typed Value.

operator‐>

Return a pointer to the tracked typed Value.

setValPtr

Point this handle at P.

operator ValueTy*

Implicit conversion to the tracked typed Value pointer.

Static Member Functions

Name

Description

GetAsValue

GetAsValue overloads

Created with MrDocs