LLVM 22.0.0git
|
Value wrapper in the Metadata hierarchy. More...
#include "llvm/IR/Metadata.h"
Public Member Functions | |
Value * | getValue () const |
Type * | getType () const |
LLVMContext & | getContext () const |
SmallVector< Metadata * > | getAllArgListUsers () |
SmallVector< DbgVariableRecord * > | getAllDbgVariableRecordUsers () |
![]() | |
unsigned | getMetadataID () const |
LLVM_ABI void | dump () const |
User-friendly dump. | |
LLVM_ABI void | dump (const Module *M) const |
LLVM_ABI void | print (raw_ostream &OS, const Module *M=nullptr, bool IsForDebug=false) const |
Print. | |
LLVM_ABI void | print (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr, bool IsForDebug=false) const |
LLVM_ABI void | printAsOperand (raw_ostream &OS, const Module *M=nullptr) const |
Print as operand. | |
LLVM_ABI void | printAsOperand (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
Static Public Member Functions | |
static LLVM_ABI ValueAsMetadata * | get (Value *V) |
static ConstantAsMetadata * | getConstant (Value *C) |
static LocalAsMetadata * | getLocal (Value *Local) |
static LLVM_ABI ValueAsMetadata * | getIfExists (Value *V) |
static ConstantAsMetadata * | getConstantIfExists (Value *C) |
static LocalAsMetadata * | getLocalIfExists (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(). | |
![]() | |
Metadata (unsigned ID, StorageType Storage) | |
~Metadata ()=default | |
void | handleChangedOperand (void *, Metadata *) |
Default handling of a changed operand, which asserts. | |
Friends | |
class | ReplaceableMetadataImpl |
class | LLVMContextImpl |
Additional Inherited Members | |
![]() | |
enum | MetadataKind |
![]() | |
static constexpr const unsigned | PoisonGeneratingIDs [] |
Metadata IDs that may generate poison. | |
![]() | |
enum | StorageType { Uniqued , Distinct , Temporary } |
Active type of storage. More... | |
![]() | |
unsigned char | Storage: 7 |
Storage flag for non-uniqued, otherwise unowned, metadata. | |
unsigned char | SubclassData1: 1 |
unsigned short | SubclassData16 = 0 |
unsigned | SubclassData32 = 0 |
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.
Definition at line 469 of file Metadata.h.
References assert().
|
protecteddefault |
Definition at line 522 of file Metadata.h.
References llvm::Metadata::getMetadataID().
|
static |
Definition at line 502 of file Metadata.cpp.
References assert(), llvm::CallingConv::C, and Context.
Referenced by addModuleFlags(), llvm::memprof::buildCallstackMetadata(), buildFrameDebugInfo(), constructEntryMetadata(), llvm::ConvertDebugDeclareToDebugValue(), llvm::DbgVariableRecord::createDbgVariableRecord(), llvm::DbgVariableRecord::createDVRAssign(), llvm::DbgVariableRecord::createDVRDeclare(), createMIBNode(), llvm::dxil::ResourceInfo::getAsMetadata(), llvm::getAsMetadata(), getAsMetadata(), getConstant(), getDbgIntrinsicValueImpl(), getLocal(), llvm::DIArgList::handleChangedOperand(), llvm::DebugValueUser::handleChangedValue(), INITIALIZE_PASS(), insertDbgValueOrDbgVariableRecord(), insertSpills(), LLVMValueAsMetadata(), llvm::DbgVariableRecord::replaceVariableLocationOp(), llvm::DbgVariableIntrinsic::replaceVariableLocationOp(), restorePreTransformState(), llvm::ReplaceableMetadataImpl::SalvageDebugInfo(), llvm::DbgVariableRecord::setAddress(), llvm::DbgAssignIntrinsic::setAddress(), llvm::DbgVariableRecord::setKillAddress(), llvm::DbgAssignIntrinsic::setValue(), updateDVIWithLocation(), and updateDVIWithLocations().
|
inline |
Definition at line 501 of file Metadata.h.
References llvm::ReplaceableMetadataImpl::getAllArgListUsers().
|
inline |
Definition at line 504 of file Metadata.h.
References llvm::ReplaceableMetadataImpl::getAllDbgVariableRecordUsers().
|
inlinestatic |
Definition at line 479 of file Metadata.h.
References llvm::CallingConv::C, and get().
Referenced by llvm::SPIRVGlobalRegistry::buildAssignType(), llvm::buildMD(), llvm::ConstantAsMetadata::get(), and wrapConstantAsMetadata().
|
inlinestatic |
Definition at line 489 of file Metadata.h.
References llvm::CallingConv::C, and getIfExists().
Referenced by llvm::ConstantAsMetadata::getIfExists().
|
inline |
Definition at line 499 of file Metadata.h.
|
static |
Definition at line 521 of file Metadata.cpp.
References assert().
Referenced by llvm::findDVRDeclares(), llvm::findDVRValues(), getConstantIfExists(), and getLocalIfExists().
|
inlinestatic |
Definition at line 483 of file Metadata.h.
Referenced by llvm::LocalAsMetadata::get().
|
inlinestatic |
Definition at line 493 of file Metadata.h.
References getIfExists(), and Local.
Referenced by llvm::LocalAsMetadata::getIfExists().
|
inline |
Definition at line 498 of file Metadata.h.
|
inline |
Definition at line 497 of file Metadata.h.
Referenced by analyzeModule(), getHiPELiteral(), getOCLKernelArgAttribute(), llvm::ConstantAsMetadata::getValue(), handleDeletion(), handleRAUW(), llvm::DbgVariableRecord::location_op_iterator::operator*(), and llvm::location_op_iterator::operator*().
|
static |
Definition at line 526 of file Metadata.cpp.
References assert(), getValue(), I, and replaceAllUsesWith().
Definition at line 545 of file Metadata.cpp.
References assert(), llvm::CallingConv::C, Context, From, llvm::ConstantAsMetadata::get(), llvm::Value::getContext(), getLocalFunctionMetadata(), getValue(), I, and replaceAllUsesWith().
|
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().
|
friend |
Definition at line 459 of file Metadata.h.
|
friend |
Definition at line 458 of file Metadata.h.