LLVM 20.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 |
void | dump () const |
User-friendly dump. | |
void | dump (const Module *M) const |
void | print (raw_ostream &OS, const Module *M=nullptr, bool IsForDebug=false) const |
Print. | |
void | print (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr, bool IsForDebug=false) const |
void | printAsOperand (raw_ostream &OS, const Module *M=nullptr) const |
Print as operand. | |
void | printAsOperand (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
Static Public Member Functions | |
static ValueAsMetadata * | get (Value *V) |
static ConstantAsMetadata * | getConstant (Value *C) |
static LocalAsMetadata * | getLocal (Value *Local) |
static ValueAsMetadata * | getIfExists (Value *V) |
static ConstantAsMetadata * | getConstantIfExists (Value *C) |
static LocalAsMetadata * | getLocalIfExists (Value *Local) |
static void | handleDeletion (Value *V) |
static 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 |
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 450 of file Metadata.h.
Definition at line 462 of file Metadata.h.
References assert().
|
protecteddefault |
Definition at line 515 of file Metadata.h.
References llvm::Metadata::getMetadataID().
|
static |
Definition at line 501 of file Metadata.cpp.
References assert(), llvm::CallingConv::C, llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::ValuesAsMetadata.
Referenced by addModuleFlags(), llvm::memprof::buildCallstackMetadata(), buildFrameDebugInfo(), llvm::ConvertDebugDeclareToDebugValue(), llvm::DbgVariableRecord::createDbgVariableRecord(), llvm::DbgVariableRecord::createDVRAssign(), llvm::DbgVariableRecord::createDVRDeclare(), createMIBNode(), llvm::hlsl::FrontendResource::FrontendResource(), llvm::dxil::ResourceInfo::getAsMetadata(), llvm::getAsMetadata(), getAsMetadata(), getConstant(), getDbgIntrinsicValueImpl(), getLocal(), llvm::DIArgList::handleChangedOperand(), llvm::DebugValueUser::handleChangedValue(), INITIALIZE_PASS(), llvm::DIBuilder::insertDbgAssign(), insertDbgValueOrDbgVariableRecord(), insertDbgValueOrDbgVariableRecordAfter(), 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 494 of file Metadata.h.
References llvm::ReplaceableMetadataImpl::getAllArgListUsers().
|
inline |
Definition at line 497 of file Metadata.h.
References llvm::ReplaceableMetadataImpl::getAllDbgVariableRecordUsers().
|
inlinestatic |
Definition at line 472 of file Metadata.h.
References llvm::CallingConv::C, and get().
Referenced by llvm::ConstantAsMetadata::get(), and wrapConstantAsMetadata().
|
inlinestatic |
Definition at line 482 of file Metadata.h.
References llvm::CallingConv::C, and getIfExists().
Referenced by llvm::ConstantAsMetadata::getIfExists().
|
inline |
Definition at line 492 of file Metadata.h.
|
static |
Definition at line 520 of file Metadata.cpp.
References assert().
Referenced by getConstantIfExists(), and getLocalIfExists().
|
inlinestatic |
Definition at line 476 of file Metadata.h.
References get().
Referenced by llvm::LocalAsMetadata::get().
|
inlinestatic |
Definition at line 486 of file Metadata.h.
References getIfExists().
Referenced by llvm::LocalAsMetadata::getIfExists().
|
inline |
Definition at line 491 of file Metadata.h.
|
inline |
Definition at line 490 of file Metadata.h.
Referenced by getHiPELiteral(), getOCLKernelArgAttribute(), llvm::ConstantAsMetadata::getValue(), handleDeletion(), handleRAUW(), llvm::DbgVariableRecord::location_op_iterator::operator*(), and llvm::location_op_iterator::operator*().
|
static |
Definition at line 525 of file Metadata.cpp.
References assert(), getValue(), I, and replaceAllUsesWith().
Referenced by llvm::Value::~Value().
Definition at line 544 of file Metadata.cpp.
References assert(), llvm::CallingConv::C, From, llvm::ConstantAsMetadata::get(), llvm::Value::getContext(), getValue(), I, llvm::LLVMContext::pImpl, replaceAllUsesWith(), and llvm::LLVMContextImpl::ValuesAsMetadata.
Referenced by llvm::Instruction::~Instruction().
|
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 510 of file Metadata.h.
References llvm::ReplaceableMetadataImpl::replaceAllUsesWith().
Referenced by llvm::GlobalObject::getAllMetadata(), handleDeletion(), and handleRAUW().
|
friend |
Definition at line 452 of file Metadata.h.
|
friend |
Definition at line 451 of file Metadata.h.