LLVM 23.0.0git
llvm::TrackingVH< ValueTy > Class Template Reference

Value handle that tracks a Value across RAUW. More...

#include "llvm/IR/ValueHandle.h"

Inheritance diagram for llvm::TrackingVH< ValueTy >:
[legend]

Public Member Functions

ValueTy * getValPtr () const
void setValPtr (ValueTy *P)
 TrackingVH ()=default
 TrackingVH (ValueTy *P)
 operator ValueTy * () const
ValueTy * operator= (ValueTy *RHS)
ValueTy * operator-> () const
ValueTy & operator* () const

Static Public Member Functions

static ValueGetAsValue (Value *V)
static ValueGetAsValue (const Value *V)

Detailed Description

template<typename ValueTy>
class llvm::TrackingVH< ValueTy >

Value handle that tracks a Value across RAUW.

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.

Definition at line 363 of file ValueHandle.h.

Constructor & Destructor Documentation

◆ TrackingVH() [1/2]

template<typename ValueTy>
llvm::TrackingVH< ValueTy >::TrackingVH ( )
default

◆ TrackingVH() [2/2]

template<typename ValueTy>
llvm::TrackingVH< ValueTy >::TrackingVH ( ValueTy * P)
inline

Definition at line 393 of file ValueHandle.h.

References P, and setValPtr().

Member Function Documentation

◆ GetAsValue() [1/2]

template<typename ValueTy>
Value * llvm::TrackingVH< ValueTy >::GetAsValue ( const Value * V)
inlinestatic

Definition at line 389 of file ValueHandle.h.

◆ GetAsValue() [2/2]

template<typename ValueTy>
Value * llvm::TrackingVH< ValueTy >::GetAsValue ( Value * V)
inlinestatic

Definition at line 388 of file ValueHandle.h.

Referenced by setValPtr().

◆ getValPtr()

template<typename ValueTy>
ValueTy * llvm::TrackingVH< ValueTy >::getValPtr ( ) const
inline

◆ operator ValueTy *()

template<typename ValueTy>
llvm::TrackingVH< ValueTy >::operator ValueTy * ( ) const
inline

Definition at line 395 of file ValueHandle.h.

◆ operator*()

template<typename ValueTy>
ValueTy & llvm::TrackingVH< ValueTy >::operator* ( ) const
inline

Definition at line 405 of file ValueHandle.h.

References getValPtr().

◆ operator->()

template<typename ValueTy>
ValueTy * llvm::TrackingVH< ValueTy >::operator-> ( ) const
inline

Definition at line 404 of file ValueHandle.h.

References getValPtr().

◆ operator=()

template<typename ValueTy>
ValueTy * llvm::TrackingVH< ValueTy >::operator= ( ValueTy * RHS)
inline

Definition at line 399 of file ValueHandle.h.

References getValPtr(), RHS, and setValPtr().

◆ setValPtr()

template<typename ValueTy>
void llvm::TrackingVH< ValueTy >::setValPtr ( ValueTy * P)
inline

Definition at line 380 of file ValueHandle.h.

References GetAsValue(), and P.

Referenced by operator=(), and TrackingVH().


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