LLVM 19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
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 >:
Inheritance graph
[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 331 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 361 of file ValueHandle.h.

References P, and llvm::TrackingVH< ValueTy >::setValPtr().

Member Function Documentation

◆ GetAsValue() [1/2]

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

Definition at line 357 of file ValueHandle.h.

◆ GetAsValue() [2/2]

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

Definition at line 356 of file ValueHandle.h.

Referenced by llvm::TrackingVH< ValueTy >::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 363 of file ValueHandle.h.

◆ operator*()

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

Definition at line 373 of file ValueHandle.h.

References llvm::TrackingVH< ValueTy >::getValPtr().

◆ operator->()

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

Definition at line 372 of file ValueHandle.h.

References llvm::TrackingVH< ValueTy >::getValPtr().

◆ operator=()

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

◆ setValPtr()

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

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