LLVM 24.0.0git
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 ReplaceableUses
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 469 of file Metadata.h.

Constructor & Destructor Documentation

◆ ValueAsMetadata()

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

◆ ~ValueAsMetadata()

llvm::ValueAsMetadata::~ValueAsMetadata ( )
protecteddefault

References LLVM_ABI, and ValueAsMetadata().

Member Function Documentation

◆ classof()

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

Definition at line 533 of file Metadata.h.

References llvm::Metadata::getMetadataID(), and llvm::Metadata::Metadata().

◆ get()

◆ getAllArgListUsers()

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

Definition at line 512 of file Metadata.h.

References llvm::ReplaceableUses::getAllArgListUsers().

◆ getAllDbgVariableRecordUsers()

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

Definition at line 515 of file Metadata.h.

References llvm::ReplaceableUses::getAllDbgVariableRecordUsers().

◆ getConstant()

◆ getConstantIfExists()

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

Definition at line 500 of file Metadata.h.

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

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

◆ getContext()

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

Definition at line 510 of file Metadata.h.

◆ getIfExists()

ValueAsMetadata * ValueAsMetadata::getIfExists ( Value * V)
static

◆ getLocal()

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

Definition at line 494 of file Metadata.h.

References llvm::cast(), get(), and Local.

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

◆ getLocalIfExists()

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

Definition at line 504 of file Metadata.h.

References llvm::cast_or_null(), getIfExists(), and Local.

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

◆ getType()

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

Definition at line 509 of file Metadata.h.

◆ getValue()

◆ handleDeletion()

void ValueAsMetadata::handleDeletion ( Value * V)
static

◆ handleRAUW()

◆ 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 528 of file Metadata.h.

References llvm::Metadata::Metadata(), and llvm::ReplaceableUses::replaceAllUsesWith().

Referenced by handleDeletion(), and handleRAUW().

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 471 of file Metadata.h.

References LLVMContextImpl.

Referenced by LLVMContextImpl.

◆ ReplaceableUses

friend class ReplaceableUses
friend

Definition at line 470 of file Metadata.h.

References ReplaceableUses.

Referenced by ReplaceableUses.


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