|
LLVM 22.0.0git
|
Root of the metadata hierarchy. More...
#include "llvm/IR/Metadata.h"
Public Types | |
| enum | MetadataKind |
Public Member Functions | |
| 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 Attributes | |
| static constexpr const unsigned | PoisonGeneratingIDs [] |
| Metadata IDs that may generate poison. | |
Protected Types | |
| enum | StorageType { Uniqued , Distinct , Temporary } |
| Active type of storage. More... | |
Protected Member Functions | |
| Metadata (unsigned ID, StorageType Storage) | |
| ~Metadata ()=default | |
| void | handleChangedOperand (void *, Metadata *) |
| Default handling of a changed operand, which asserts. | |
Protected Attributes | |
| unsigned char | Storage: 7 |
| Storage flag for non-uniqued, otherwise unowned, metadata. | |
| unsigned char | SubclassData1: 1 |
| unsigned short | SubclassData16 = 0 |
| unsigned | SubclassData32 = 0 |
Friends | |
| class | ReplaceableMetadataImpl |
Root of the metadata hierarchy.
This is a root class for typeless data in the IR.
Definition at line 64 of file Metadata.h.
Definition at line 82 of file Metadata.h.
|
protected |
Active type of storage.
| Enumerator | |
|---|---|
| Uniqued | |
| Distinct | |
| Temporary | |
Definition at line 72 of file Metadata.h.
|
inlineprotected |
Definition at line 88 of file Metadata.h.
References Storage, and SubclassData1.
Referenced by llvm::DIArgList::classof(), llvm::MDNode::classof(), llvm::MDString::classof(), llvm::ValueAsMetadata::classof(), llvm::DistinctMDOperandPlaceholder::DistinctMDOperandPlaceholder(), llvm::MDNode::getMergedCalleeTypeMetadata(), llvm::DIArgList::handleChangedOperand(), handleChangedOperand(), llvm::MDNode::intersect(), llvm::DIArgList::LLVMContextImpl, llvm::MDNode::MDNode(), llvm::DistinctMDOperandPlaceholder::MetadataTracking, llvm::MDNode::replaceAllUsesWith(), llvm::ValueAsMetadata::replaceAllUsesWith(), llvm::MDNode::replaceOperandWith(), llvm::DistinctMDOperandPlaceholder::replaceUseWith(), llvm::MDNode::setOperand(), llvm::MDNode::toCaptureComponents(), and llvm::ValueAsMetadata::ValueAsMetadata().
|
protecteddefault |
| LLVM_DUMP_METHOD void Metadata::dump | ( | ) | const |
User-friendly dump.
If M is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.
Note: this uses an explicit overload instead of default arguments so that the nullptr version is easy to call from a debugger.
Definition at line 5448 of file AsmWriter.cpp.
References llvm::dump(), and dump().
Referenced by dump(), dump(), and llvm::SDValue::dump().
| LLVM_DUMP_METHOD void Metadata::dump | ( | const Module * | M | ) | const |
Definition at line 5451 of file AsmWriter.cpp.
References llvm::dbgs(), dump(), and print().
|
inline |
Definition at line 104 of file Metadata.h.
Referenced by llvm::ConstantAsMetadata::classof(), llvm::DIArgList::classof(), llvm::DIAssignID::classof(), llvm::DIBasicType::classof(), llvm::DICommonBlock::classof(), llvm::DICompileUnit::classof(), llvm::DICompositeType::classof(), llvm::DIDerivedType::classof(), llvm::DIEnumerator::classof(), llvm::DIExpression::classof(), llvm::DIFile::classof(), llvm::DIFixedPointType::classof(), llvm::DIGenericSubrange::classof(), llvm::DIGlobalVariable::classof(), llvm::DIGlobalVariableExpression::classof(), llvm::DILabel::classof(), llvm::DILexicalBlock::classof(), llvm::DILexicalBlockBase::classof(), llvm::DILexicalBlockFile::classof(), llvm::DILocalScope::classof(), llvm::DILocalVariable::classof(), llvm::DILocation::classof(), llvm::DIMacro::classof(), llvm::DIMacroFile::classof(), llvm::DIMacroNode::classof(), llvm::DINamespace::classof(), llvm::DINode::classof(), llvm::DIObjCProperty::classof(), llvm::DIScope::classof(), llvm::DIStringType::classof(), llvm::DISubprogram::classof(), llvm::DISubrange::classof(), llvm::DISubrangeType::classof(), llvm::DISubroutineType::classof(), llvm::DITemplateParameter::classof(), llvm::DITemplateTypeParameter::classof(), llvm::DITemplateValueParameter::classof(), llvm::DIType::classof(), llvm::DIVariable::classof(), llvm::GenericDINode::classof(), llvm::LocalAsMetadata::classof(), llvm::MDNode::classof(), llvm::MDString::classof(), llvm::MDTuple::classof(), llvm::ValueAsMetadata::classof(), llvm::MDNode::clone(), llvm::ReplaceableMetadataImpl::getAllArgListUsers(), llvm::MDNode::isAlwaysReplaceable(), llvm::ReplaceableMetadataImpl::replaceAllUsesWith(), llvm::MDNode::resize(), and llvm::MDNode::storeDistinctInContext().
|
inlineprotected |
Default handling of a changed operand, which asserts.
If subclasses pass themselves in as owners to a tracking node reference, they must provide an implementation of this method.
Definition at line 99 of file Metadata.h.
References llvm_unreachable, and Metadata().
| void Metadata::print | ( | raw_ostream & | OS, |
| const Module * | M = nullptr, | ||
| bool | IsForDebug = false ) const |
Print.
Prints definition of this.
If M is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.
Definition at line 5371 of file AsmWriter.cpp.
References llvm::isa(), print(), and printMetadataImpl().
Referenced by llvm::operator<<(), print(), print(), and llvm::ValueEnumerator::print().
| void Metadata::print | ( | raw_ostream & | OS, |
| ModuleSlotTracker & | MST, | ||
| const Module * | M = nullptr, | ||
| bool | IsForDebug = false ) const |
Definition at line 5377 of file AsmWriter.cpp.
References print(), and printMetadataImpl().
| void Metadata::printAsOperand | ( | raw_ostream & | OS, |
| const Module * | M = nullptr ) const |
Print as operand.
Prints reference of this.
If M is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.
Definition at line 5361 of file AsmWriter.cpp.
References llvm::isa(), printAsOperand(), and printMetadataImpl().
Referenced by llvm::MachineInstr::print(), llvm::MachineMemOperand::print(), llvm::MachineOperand::print(), printAsOperand(), and printAsOperand().
| void Metadata::printAsOperand | ( | raw_ostream & | OS, |
| ModuleSlotTracker & | MST, | ||
| const Module * | M = nullptr ) const |
Definition at line 5366 of file AsmWriter.cpp.
References printAsOperand(), and printMetadataImpl().
|
friend |
Definition at line 65 of file Metadata.h.
References ReplaceableMetadataImpl.
Referenced by ReplaceableMetadataImpl.
Metadata IDs that may generate poison.
Definition at line 146 of file Metadata.h.
Referenced by doPromotion(), and llvm::InstCombinerImpl::visitLoadInst().
Storage flag for non-uniqued, otherwise unowned, metadata.
Definition at line 75 of file Metadata.h.
Referenced by llvm::DIBasicType::DIBasicType(), llvm::DIBasicType::DIBasicType(), llvm::DILexicalBlockBase::DILexicalBlockBase(), llvm::DILocalScope::DILocalScope(), llvm::DIMacroNode::DIMacroNode(), llvm::DINode::DINode(), llvm::DIScope::DIScope(), llvm::DITemplateParameter::DITemplateParameter(), llvm::DIType::DIType(), llvm::DIVariable::DIVariable(), llvm::DIBasicType::getImpl(), llvm::DIBasicType::getImpl(), llvm::DIBasicType::getImpl(), llvm::MDNode::isDistinct(), llvm::MDNode::isTemporary(), llvm::MDNode::isUniqued(), llvm::DIAssignID::MDNode, llvm::DICommonBlock::MDNode, llvm::DICompositeType::MDNode, llvm::DIDerivedType::MDNode, llvm::DIEnumerator::MDNode, llvm::DIExpression::MDNode, llvm::DIFixedPointType::MDNode, llvm::DIGenericSubrange::MDNode, llvm::DIGlobalVariable::MDNode, llvm::DIGlobalVariableExpression::MDNode, llvm::DIImportedEntity::MDNode, llvm::DILabel::MDNode, llvm::DILexicalBlock::MDNode, llvm::DILexicalBlockFile::MDNode, llvm::DILocalVariable::MDNode, llvm::DILocation::MDNode, llvm::DIMacro::MDNode, llvm::DIMacroFile::MDNode, llvm::DIModule::MDNode, llvm::DINamespace::MDNode, llvm::DIObjCProperty::MDNode, llvm::DIStringType::MDNode, llvm::DISubrange::MDNode, llvm::DISubrangeType::MDNode, llvm::DISubroutineType::MDNode, llvm::DITemplateTypeParameter::MDNode, llvm::DITemplateValueParameter::MDNode, llvm::GenericDINode::MDNode, llvm::MDNode::MDNode(), llvm::MDTuple::MDNode, Metadata(), llvm::MDNode::storeDistinctInContext(), llvm::MDNode::storeImpl(), llvm::MDNode::storeImpl(), and llvm::MDNode::~MDNode().
Definition at line 77 of file Metadata.h.
Referenced by llvm::DITemplateParameter::DITemplateParameter(), llvm::DINamespace::getExportSymbols(), llvm::DITemplateParameter::isDefault(), and Metadata().
|
protected |
Definition at line 78 of file Metadata.h.
Referenced by llvm::DIMacroNode::getMacinfoType(), llvm::DINode::getTag(), llvm::GenericDINode::getTag(), and llvm::DINode::setTag().
|
protected |
Definition at line 79 of file Metadata.h.
Referenced by llvm::DistinctMDOperandPlaceholder::DistinctMDOperandPlaceholder(), llvm::DIVariable::DIVariable(), llvm::DIType::getAlignInBits(), llvm::DIVariable::getAlignInBits(), llvm::DILexicalBlockFile::getDiscriminator(), llvm::GenericDINode::getHash(), llvm::MDTuple::getHash(), llvm::DistinctMDOperandPlaceholder::getID(), llvm::DILabel::getLine(), llvm::DILexicalBlock::getLine(), llvm::DIMacro::getLine(), llvm::DIMacroFile::getLine(), llvm::DICommonBlock::getLineNo(), llvm::DIType::init(), llvm::DIEnumerator::isUnsigned(), llvm::DIDerivedType::MDNode, llvm::DIImportedEntity::MDNode, llvm::DILexicalBlock::MDNode, llvm::DILexicalBlockFile::MDNode, llvm::DIMacro::MDNode, and llvm::DIMacroFile::MDNode.