LLVM 22.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::ValueAsMetadata Class Reference

Value wrapper in the Metadata hierarchy. More...

#include "llvm/IR/Metadata.h"

Inheritance diagram for llvm::ValueAsMetadata:
[legend]

Public Member Functions

ValuegetValue () const
 
TypegetType () const
 
LLVMContextgetContext () const
 
SmallVector< Metadata * > getAllArgListUsers ()
 
SmallVector< DbgVariableRecord * > getAllDbgVariableRecordUsers ()
 

Static Public Member Functions

static LLVM_ABI ValueAsMetadataget (Value *V)
 
static ConstantAsMetadatagetConstant (Value *C)
 
static LocalAsMetadatagetLocal (Value *Local)
 
static LLVM_ABI ValueAsMetadatagetIfExists (Value *V)
 
static ConstantAsMetadatagetConstantIfExists (Value *C)
 
static LocalAsMetadatagetLocalIfExists (Value *Local)
 
static LLVM_ABI void handleDeletion (Value *V)
 
static LLVM_ABI void handleRAUW (Value *From, Value *To)
 
static bool classof (const Metadata *MD)
 

Protected Member Functions

 ValueAsMetadata (unsigned ID, Value *V)
 
 ~ValueAsMetadata ()=default
 
void replaceAllUsesWith (Metadata *MD)
 Handle collisions after Value::replaceAllUsesWith().
 

Friends

class ReplaceableMetadataImpl
 
class LLVMContextImpl
 

Additional Inherited Members

 Active type of storage. More...

Detailed Description

Value wrapper in the Metadata hierarchy.

This is a custom value handle that allows other metadata to refer to classes in the Value hierarchy.

Because of full uniquing support, each value is only wrapped by a single ValueAsMetadata object, so the lookup maps are far more efficient than those using ValueHandleBase.

Definition at line 457 of file Metadata.h.

Constructor & Destructor Documentation

◆ ValueAsMetadata()

llvm::ValueAsMetadata::ValueAsMetadata ( unsigned  ID,
Value V 
)
inlineprotected

Definition at line 469 of file Metadata.h.

References assert().

◆ ~ValueAsMetadata()

llvm::ValueAsMetadata::~ValueAsMetadata ( )
protecteddefault

Member Function Documentation

◆ classof()

static bool llvm::ValueAsMetadata::classof ( const Metadata MD)
inlinestatic

Definition at line 522 of file Metadata.h.

References llvm::Metadata::getMetadataID().

◆ get()

ValueAsMetadata * ValueAsMetadata::get ( Value V)
static

◆ getAllArgListUsers()

SmallVector< Metadata * > llvm::ValueAsMetadata::getAllArgListUsers ( )
inline

Definition at line 501 of file Metadata.h.

References llvm::ReplaceableMetadataImpl::getAllArgListUsers().

◆ getAllDbgVariableRecordUsers()

SmallVector< DbgVariableRecord * > llvm::ValueAsMetadata::getAllDbgVariableRecordUsers ( )
inline

◆ getConstant()

static ConstantAsMetadata * llvm::ValueAsMetadata::getConstant ( Value C)
inlinestatic

◆ getConstantIfExists()

static ConstantAsMetadata * llvm::ValueAsMetadata::getConstantIfExists ( Value C)
inlinestatic

Definition at line 489 of file Metadata.h.

References llvm::CallingConv::C, and getIfExists().

Referenced by llvm::ConstantAsMetadata::getIfExists().

◆ getContext()

LLVMContext & llvm::ValueAsMetadata::getContext ( ) const
inline

Definition at line 499 of file Metadata.h.

◆ getIfExists()

ValueAsMetadata * ValueAsMetadata::getIfExists ( Value V)
static

◆ getLocal()

static LocalAsMetadata * llvm::ValueAsMetadata::getLocal ( Value Local)
inlinestatic

Definition at line 483 of file Metadata.h.

References get(), and Local.

Referenced by llvm::LocalAsMetadata::get().

◆ getLocalIfExists()

static LocalAsMetadata * llvm::ValueAsMetadata::getLocalIfExists ( Value Local)
inlinestatic

Definition at line 493 of file Metadata.h.

References getIfExists(), and Local.

Referenced by llvm::LocalAsMetadata::getIfExists().

◆ getType()

Type * llvm::ValueAsMetadata::getType ( ) const
inline

Definition at line 498 of file Metadata.h.

◆ getValue()

Value * llvm::ValueAsMetadata::getValue ( ) const
inline

◆ handleDeletion()

void ValueAsMetadata::handleDeletion ( Value V)
static

Definition at line 526 of file Metadata.cpp.

References assert(), getValue(), I, and replaceAllUsesWith().

◆ handleRAUW()

void ValueAsMetadata::handleRAUW ( Value From,
Value To 
)
static

◆ replaceAllUsesWith()

void llvm::ValueAsMetadata::replaceAllUsesWith ( Metadata MD)
inlineprotected

Handle collisions after Value::replaceAllUsesWith().

RAUW isn't supported directly for ValueAsMetadata, but if the wrapped Value gets RAUW'ed and the target already exists, this is used to merge the two metadata nodes.

Definition at line 517 of file Metadata.h.

References llvm::ReplaceableMetadataImpl::replaceAllUsesWith().

Referenced by handleDeletion(), and handleRAUW().

Friends And Related Function Documentation

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 459 of file Metadata.h.

◆ ReplaceableMetadataImpl

friend class ReplaceableMetadataImpl
friend

Definition at line 458 of file Metadata.h.


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