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 () |
Public Member Functions inherited from llvm::Metadata | |
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(). | |
Protected Member Functions inherited from llvm::Metadata | |
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 | |
Public Types inherited from llvm::Metadata | |
enum | MetadataKind |
Static Public Attributes inherited from llvm::Metadata | |
static constexpr const unsigned | PoisonGeneratingIDs [] |
Metadata IDs that may generate poison. | |
Protected Types inherited from llvm::Metadata | |
enum | StorageType { Uniqued , Distinct , Temporary } |
Active type of storage. More... | |
Protected Attributes inherited from llvm::Metadata | |
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(), getContext(), llvm::Metadata::Metadata(), ReplaceableMetadataImpl, and llvm::Metadata::Uniqued.
Referenced by get(), getIfExists(), handleDeletion(), handleRAUW(), and ~ValueAsMetadata().
|
protecteddefault |
References LLVM_ABI, and ValueAsMetadata().
Definition at line 522 of file Metadata.h.
References llvm::Metadata::getMetadataID(), and llvm::Metadata::Metadata().
|
static |
Definition at line 502 of file Metadata.cpp.
References assert(), llvm::CallingConv::C, llvm::dyn_cast(), llvm::isa(), and ValueAsMetadata().
Referenced by addModuleFlags(), llvm::memprof::buildCallstackMetadata(), buildFrameDebugInfo(), constructEntryMetadata(), llvm::ConvertDebugDeclareToDebugValue(), llvm::ConvertDebugDeclareToDebugValue(), llvm::DbgVariableRecord::createDbgVariableRecord(), llvm::DbgVariableRecord::createDVRAssign(), llvm::DbgVariableRecord::createDVRDeclare(), createMIBNode(), getAsMetadata(), llvm::dxil::ResourceInfo::getAsMetadata(), llvm::getAsMetadata(), getConstant(), getDbgIntrinsicValueImpl(), getLocal(), llvm::DIArgList::handleChangedOperand(), llvm::DebugValueUser::handleChangedValue(), insertDbgValueOrDbgVariableRecord(), insertSpills(), LLVMValueAsMetadata(), llvm::DbgVariableIntrinsic::replaceVariableLocationOp(), llvm::DbgVariableIntrinsic::replaceVariableLocationOp(), llvm::DbgVariableRecord::replaceVariableLocationOp(), llvm::DbgVariableRecord::replaceVariableLocationOp(), restorePreTransformState(), llvm::ReplaceableMetadataImpl::SalvageDebugInfo(), llvm::DbgAssignIntrinsic::setAddress(), llvm::DbgVariableRecord::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, llvm::cast(), 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, llvm::cast_or_null(), and getIfExists().
Referenced by llvm::ConstantAsMetadata::getIfExists().
|
inline |
Definition at line 499 of file Metadata.h.
Referenced by ValueAsMetadata().
|
static |
Definition at line 521 of file Metadata.cpp.
References assert(), and ValueAsMetadata().
Referenced by llvm::findDVRDeclares(), llvm::findDVRValues(), getConstantIfExists(), and getLocalIfExists().
|
inlinestatic |
Definition at line 483 of file Metadata.h.
References llvm::cast(), get(), and Local.
Referenced by llvm::LocalAsMetadata::get().
|
inlinestatic |
Definition at line 493 of file Metadata.h.
References llvm::cast_or_null(), 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*(), llvm::DbgVariableRecord::location_op_iterator::operator*(), llvm::location_op_iterator::operator*(), and llvm::location_op_iterator::operator*().
|
static |
Definition at line 526 of file Metadata.cpp.
References assert(), getValue(), I, replaceAllUsesWith(), and ValueAsMetadata().
Definition at line 545 of file Metadata.cpp.
References assert(), llvm::CallingConv::C, llvm::dyn_cast(), llvm::ConstantAsMetadata::get(), llvm::Type::getContext(), llvm::Value::getContext(), getLocalFunctionMetadata(), llvm::Value::getType(), getValue(), I, llvm::isa(), llvm::Value::IsUsedByMD, replaceAllUsesWith(), and ValueAsMetadata().
|
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::Metadata::Metadata(), and llvm::ReplaceableMetadataImpl::replaceAllUsesWith().
Referenced by handleDeletion(), and handleRAUW().
|
friend |
Definition at line 459 of file Metadata.h.
References LLVMContextImpl.
Referenced by LLVMContextImpl.
|
friend |
Definition at line 458 of file Metadata.h.
References ReplaceableMetadataImpl.
Referenced by ReplaceableMetadataImpl, and ValueAsMetadata().