LLVM
15.0.0git
|
#include "llvm/IR/Metadata.h"
Classes | |
struct | HasCachedHash |
Public Types | |
using | op_iterator = const MDOperand * |
using | op_range = iterator_range< op_iterator > |
![]() | |
enum | MetadataKind |
Public Member Functions | |
MDNode (const MDNode &)=delete | |
void | operator= (const MDNode &)=delete |
void * | operator new (size_t)=delete |
TempMDNode | clone () const |
Create a (temporary) clone of this. More... | |
LLVMContext & | getContext () const |
void | replaceOperandWith (unsigned I, Metadata *New) |
Replace a specific operand. More... | |
bool | isResolved () const |
Check if node is fully resolved. More... | |
bool | isUniqued () const |
bool | isDistinct () const |
bool | isTemporary () const |
void | replaceAllUsesWith (Metadata *MD) |
RAUW a temporary. More... | |
void | resolveCycles () |
Resolve cycles. More... | |
void | resolve () |
Resolve a unique, unresolved node. More... | |
op_iterator | op_begin () const |
op_iterator | op_end () const |
op_range | operands () const |
const MDOperand & | getOperand (unsigned I) const |
unsigned | getNumOperands () const |
Return number of MDNode operands. More... | |
bool | isTBAAVtableAccess () const |
Check whether MDNode is a vtable access. More... | |
void | printTree (raw_ostream &OS, const Module *M=nullptr) const |
Print in tree shape. More... | |
void | printTree (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
void | dumpTree () const |
User-friendly dump in tree shape. More... | |
void | dumpTree (const Module *M) const |
![]() | |
unsigned | getMetadataID () const |
void | dump () const |
User-friendly dump. More... | |
void | dump (const Module *M) const |
void | print (raw_ostream &OS, const Module *M=nullptr, bool IsForDebug=false) const |
Print. More... | |
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. More... | |
void | printAsOperand (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
Static Public Member Functions | |
static MDTuple * | get (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static MDTuple * | getIfExists (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static MDTuple * | getDistinct (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static TempMDTuple | getTemporary (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static void | deleteTemporary (MDNode *N) |
Deallocate a node created by getTemporary. More... | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithPermanent (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a permanent one. More... | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithUniqued (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a uniqued one. More... | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithDistinct (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a distinct one. More... | |
static bool | classof (const Metadata *MD) |
Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
static MDNode * | concatenate (MDNode *A, MDNode *B) |
Methods for metadata merging. More... | |
static MDNode * | intersect (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericTBAA (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericFPMath (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericRange (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericAliasScope (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericAlignmentOrDereferenceable (MDNode *A, MDNode *B) |
Protected Types | |
using | mutable_op_range = iterator_range< MDOperand * > |
![]() | |
enum | StorageType { Uniqued, Distinct, Temporary } |
Active type of storage. More... | |
Protected Member Functions | |
MDNode (LLVMContext &Context, unsigned ID, StorageType Storage, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2=None) | |
~MDNode ()=default | |
void * | operator new (size_t Size, unsigned NumOps, StorageType Storage) |
void | operator delete (void *Mem) |
void | operator delete (void *, unsigned) |
Required by std, but never called. More... | |
void | operator delete (void *, unsigned, bool) |
Required by std, but never called. More... | |
void | dropAllReferences () |
MDOperand * | mutable_begin () |
MDOperand * | mutable_end () |
mutable_op_range | mutable_operands () |
void | setOperand (unsigned I, Metadata *New) |
Set an operand. More... | |
unsigned | getNumUnresolved () const |
void | setNumUnresolved (unsigned N) |
void | storeDistinctInContext () |
![]() | |
Metadata (unsigned ID, StorageType Storage) | |
~Metadata ()=default | |
void | handleChangedOperand (void *, Metadata *) |
Default handling of a changed operand, which asserts. More... | |
Static Protected Member Functions | |
template<class T , class StoreT > | |
static T * | storeImpl (T *N, StorageType Storage, StoreT &Store) |
template<class T > | |
static T * | storeImpl (T *N, StorageType Storage) |
Friends | |
class | ReplaceableMetadataImpl |
class | LLVMContextImpl |
class | DIArgList |
Additional Inherited Members | |
![]() | |
unsigned char | Storage: 7 |
Storage flag for non-uniqued, otherwise unowned, metadata. More... | |
unsigned char | SubclassData1: 1 |
unsigned short | SubclassData16 = 0 |
unsigned | SubclassData32 = 0 |
Metadata node.
Metadata nodes can be uniqued, like constants, or distinct. Temporary metadata nodes (with full support for RAUW) can be used to delay uniquing until forward references are known. The basic metadata node is an MDTuple.
There is limited support for RAUW at construction time. At construction time, if any operand is a temporary node (or an unresolved uniqued node, which indicates a transitive temporary operand), the node itself will be unresolved. As soon as all operands become resolved, it will drop RAUW support permanently.
If an unresolved node is part of a cycle, resolveCycles() needs to be called on some member of the cycle once all temporary nodes have been replaced.
Definition at line 926 of file Metadata.h.
|
protected |
Definition at line 992 of file Metadata.h.
using llvm::MDNode::op_iterator = const MDOperand * |
Definition at line 1180 of file Metadata.h.
Definition at line 1181 of file Metadata.h.
|
protected |
Definition at line 543 of file Metadata.cpp.
References isUniqued(), and setOperand().
|
protecteddefault |
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 1202 of file Metadata.h.
References llvm::Metadata::getMetadataID().
TempMDNode MDNode::clone | ( | ) | const |
Create a (temporary) clone of this.
Definition at line 560 of file Metadata.cpp.
References llvm::Metadata::getMetadataID(), and llvm_unreachable.
Referenced by llvm::DIType::clone().
Methods for metadata merging.
Definition at line 946 of file Metadata.cpp.
References B, llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::getArrayRef(), getOrSelfReference(), and llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert().
Referenced by AddAliasScopeMetadata(), llvm::LoopVersioning::annotateInstWithNoAlias(), and PropagateCallSiteMetadata().
|
static |
Deallocate a node created by getTemporary.
Calls replaceAllUsesWith(nullptr)
before deleting, so any remaining references will be reset.
Definition at line 881 of file Metadata.cpp.
Referenced by LLVMDisposeTemporaryMDNode(), and llvm::TempMDNodeDeleter::operator()().
|
protected |
Definition at line 739 of file Metadata.cpp.
References Context, E, getNumOperands(), I, and setOperand().
LLVM_DUMP_METHOD void MDNode::dumpTree | ( | ) | const |
User-friendly dump in tree shape.
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 4854 of file AsmWriter.cpp.
LLVM_DUMP_METHOD void MDNode::dumpTree | ( | const Module * | M | ) | const |
Definition at line 4857 of file AsmWriter.cpp.
References llvm::dbgs(), M, and printTree().
|
inlinestatic |
Definition at line 1289 of file Metadata.h.
References Context, and llvm::MDTuple::get().
Referenced by llvm::adaptNoAliasScopes(), AddAliasScopeMetadata(), llvm::Module::addModuleFlag(), addModuleFlags(), AddRuntimeUnrollDisableMetaData(), llvm::DbgVariableIntrinsic::addVariableLocationOps(), llvm::LoopVersioning::annotateInstWithNoAlias(), llvm::annotateValueSite(), llvm::DIExpression::append(), llvm::DIExpression::appendOpsToArg(), llvm::OpenMPIRBuilder::applySimd(), avoidZeroOffsetLandingPad(), canonicalizeMetadataForValue(), llvm::DILocation::cloneWithDiscriminator(), collectCallSiteParameters(), llvm::DIExpression::constantFold(), llvm::GlobalObject::copyMetadata(), llvm::copyRangeMetadata(), createAccessTag(), llvm::MDBuilder::createAliasScope(), llvm::MDBuilder::createAliasScopeDomain(), llvm::DIBuilder::createArrayType(), llvm::DIBuilder::createBasicType(), llvm::DIBuilder::createBitFieldMemberType(), llvm::MDBuilder::createBranchWeights(), llvm::MDBuilder::createCallbackEncoding(), llvm::MDBuilder::createCallees(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createCommonBlock(), llvm::DIBuilder::createConstantValueExpression(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), llvm::DIBuilder::createExpression(), llvm::DIBuilder::createFile(), llvm::DIBuilder::createForwardDecl(), llvm::MDBuilder::createFPMath(), llvm::DIExpression::createFragmentExpression(), llvm::DIBuilder::createFriend(), llvm::MDBuilder::createFunctionEntryCount(), llvm::MDBuilder::createFunctionSectionPrefix(), llvm::DIBuilder::createGlobalVariableExpression(), createImportedModule(), llvm::DIBuilder::createInheritance(), llvm::MDBuilder::createIrrLoopHeaderWeight(), llvm::DIBuilder::createLexicalBlockFile(), llvm::DIBuilder::createMacro(), llvm::DIBuilder::createMemberPointerType(), llvm::DIBuilder::createMemberType(), llvm::createMemCpyLoopKnownSize(), llvm::DIBuilder::createModule(), llvm::DIBuilder::createNameSpace(), llvm::DIBuilder::createObjCIVar(), llvm::DIBuilder::createObjCProperty(), llvm::OpenMPIRBuilder::createParallel(), llvm::createPGOFuncNameMetadata(), llvm::DIBuilder::createPointerType(), llvm::MDBuilder::createPseudoProbeDesc(), llvm::DIBuilder::createQualifiedType(), llvm::MDBuilder::createRange(), llvm::DIBuilder::createReferenceType(), llvm::DIBuilder::createSetType(), llvm::DIBuilder::createStaticMemberType(), createStringMetadata(), llvm::DIBuilder::createStringType(), llvm::DIBuilder::createStructType(), llvm::DIBuilder::createSubroutineType(), llvm::MDBuilder::createTBAAAccessTag(), llvm::MDBuilder::createTBAANode(), llvm::MDBuilder::createTBAARoot(), llvm::MDBuilder::createTBAAScalarTypeNode(), llvm::MDBuilder::createTBAAStructNode(), llvm::MDBuilder::createTBAAStructTagNode(), llvm::MDBuilder::createTBAAStructTypeNode(), llvm::MDBuilder::createTBAATypeNode(), llvm::DIBuilder::createTemplateParameterPack(), llvm::DIBuilder::createTemplateTypeParameter(), createTemplateValueParameterHelper(), llvm::DIBuilder::createTypedef(), llvm::DIBuilder::createUnionType(), llvm::MDBuilder::createUnpredictable(), llvm::DIBuilder::createUnspecifiedType(), llvm::DIBuilder::createVariantMemberType(), llvm::DIBuilder::createVariantPart(), llvm::DIBuilder::createVectorType(), llvm::MipsInstrInfo::describeLoadedValue(), llvm::X86InstrInfo::describeLoadedValue(), llvm::TargetInstrInfo::describeLoadedValue(), describeMOVrrLoadedValue(), describeORRLoadedValue(), DisableAllLoopOptsOnLoop(), llvm::Instruction::dropLocation(), emitDXILValidatorVersion(), TransferTracker::emitMOLoc(), llvm::InstrumentationIRBuilder::ensureDebugInfo(), llvm::AAMDNodes::extendToTBAA(), llvm::DIExpression::extractAddressClass(), extractMDNode(), llvm::DIBuilder::finalize(), llvm::DIBuilder::finalizeSubprogram(), fixupDebugInfoPostExtraction(), foldCtpop(), foldCttzCtlz(), getDebugValueLoc(), llvm::DebugLoc::getFnDebugLoc(), llvm::DILocation::getMergedLocation(), getMostGenericRange(), getOrCreateDebugLoc(), llvm::DIBuilder::getOrCreateGenericSubrange(), llvm::OpenMPIRBuilder::getOrCreateRuntimeFunction(), llvm::DIBuilder::getOrCreateSubrange(), llvm::DIBuilder::getOrCreateTypeArray(), getOrSelfReference(), getSubprogram(), inlineDebugLoc(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::SampleProfileProber::instrumentOneFunc(), interpretValues(), LLVMDIBuilderCreateDebugLocation(), LLVMMDNodeInContext(), LLVMMDNodeInContext2(), llvm::makeFollowupLoopID(), llvm::MDBuilder::mergeCallbackEncodings(), moveFunctionData(), llvm::LoopVersioning::prepareNoAliasMetadata(), llvm::DIExpression::prependOpcodes(), llvm::DIExpression::replaceArg(), llvm::DbgVariableIntrinsic::replaceVariableLocationOp(), restorePreTransformState(), llvm::SimpleLoopUnswitchPass::run(), runOnFunction(), llvm::LoopVectorizeHints::setAlreadyVectorized(), llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopMustProgress(), llvm::GlobalObject::setVCallVisibilityMetadata(), llvm::AAMDNodes::shiftTBAAStruct(), splitGlobal(), llvm::Instruction::swapProfMetadata(), transferSRADebugInfo(), TryToShrinkGlobalToBoolean(), llvm::uniteAccessGroups(), llvm::OpenMPIRBuilder::unrollLoopFull(), llvm::OpenMPIRBuilder::unrollLoopHeuristic(), llvm::OpenMPIRBuilder::unrollLoopPartial(), updateDVIWithLocations(), llvm::CallInst::updateProfWeight(), llvm::UpgradeModuleFlags(), llvm::UpgradeTBAANode(), and llvm::InstCombinerImpl::visitCallInst().
|
inline |
Definition at line 1020 of file Metadata.h.
References Context.
Referenced by llvm::DIExpression::append(), llvm::DIExpression::appendOpsToArg(), llvm::DILocation::cloneWithDiscriminator(), llvm::DIExpression::constantFold(), createAccessTag(), llvm::DIExpression::createFragmentExpression(), LiveDebugValues::MLocTracker::emitLoc(), TransferTracker::emitMOLoc(), llvm::AAMDNodes::extendToTBAA(), llvm::DIExpression::extractAddressClass(), getOrCreateDebugLoc(), llvm::makeFollowupLoopID(), llvm::DIExpression::prependOpcodes(), llvm::DIExpression::replaceArg(), llvm::DbgVariableIntrinsic::setVariable(), llvm::AAMDNodes::shiftTBAAStruct(), storeDistinctInContext(), llvm::Instruction::swapProfMetadata(), transferSRADebugInfo(), llvm::uniteAccessGroups(), updateLoopMetadataDebugLocationsImpl(), and llvm::UpgradeTBAANode().
|
inlinestatic |
Definition at line 1297 of file Metadata.h.
References Context, and llvm::MDTuple::getDistinct().
Referenced by addLoopMetadata(), llvm::DebugLoc::appendInlinedAt(), llvm::OpenMPIRBuilder::applySimd(), llvm::DICompositeType::buildODRType(), llvm::MDBuilder::createAnonymousAARoot(), llvm::DIBuilder::createCompileUnit(), llvm::DIBuilder::createGlobalVariableExpression(), llvm::DIBuilder::createLexicalBlock(), fixupLineNumbers(), getSubprogram(), llvm::makePostTransformationMetadata(), and updateLoopMetadataDebugLocationsImpl().
|
inlinestatic |
Definition at line 1293 of file Metadata.h.
References Context, and llvm::MDTuple::getIfExists().
Definition at line 973 of file Metadata.cpp.
References B, llvm::SmallPtrSetImpl< PtrType >::contains(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::empty(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::getArrayRef(), getDomain(), getOrSelfReference(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), and llvm::SmallPtrSetImpl< PtrType >::insert().
Referenced by llvm::combineMetadata(), llvm::AAMDNodes::concat(), llvm::AAMDNodes::merge(), and llvm::propagateMetadata().
Definition at line 1125 of file Metadata.cpp.
References B, and llvm::ConstantInt::getZExtValue().
Referenced by llvm::combineMetadata().
Definition at line 1005 of file Metadata.cpp.
References B.
Referenced by llvm::combineMetadata(), and llvm::propagateMetadata().
Definition at line 1053 of file Metadata.cpp.
References addRange(), B, llvm::ConstantAsMetadata::get(), get(), llvm::ConstantInt::getValue(), i, I, llvm::ConstantRange::isFullSet(), llvm::SmallVectorImpl< T >::reserve(), llvm::SmallVectorImpl< T >::resize(), llvm::APInt::slt(), and tryMergeRange().
Referenced by llvm::combineMetadata().
Definition at line 476 of file TypeBasedAliasAnalysis.cpp.
References B, and matchAccessTags().
Referenced by llvm::combineMetadata(), llvm::AAMDNodes::merge(), and llvm::propagateMetadata().
|
inline |
Return number of MDNode operands.
Definition at line 1199 of file Metadata.h.
Referenced by llvm::AbstractCallSite::AbstractCallSite(), AddRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), addToAccessGroupList(), llvm::cacheAnnotationFromMD(), checkMDProf(), llvm::computeKnownBitsFromRangeMetadata(), llvm::ConstantFoldTerminator(), createAccessTag(), dropAllReferences(), llvm::MachineInstr::emitError(), llvm::findOptionMDForLoopID(), llvm::findStringMetadataForLoop(), GetBranchWeights(), llvm::getConstantRangeFromMetadata(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeAttributes(), llvm::ProfileSummary::getFromMD(), getLocCookie(), llvm::Loop::getLoopID(), llvm::GenericDINode::getNumDwarfOperands(), getOperand(), llvm::getOptionalBoolLoopAttribute(), getOptionalVal(), llvm::DILocation::getRawInlinedAt(), getSummaryFromMD(), llvm::GetUnrollMetadata(), getValMD(), llvm::getValueProfDataFromInst(), llvm::SwitchInstProfUpdateWrapper::init(), llvm::intersectAccessGroups(), isKeyValuePair(), AliasScopeTracker::isNoAliasScopeDeclDead(), IsRootTBAANode(), IsScalarTBAANodeImpl(), isStructPathTBAA(), isTBAAVtableAccess(), llvm::Module::isValidModuleFlag(), loadDXILValidatorVersion(), llvm::makeFollowupLoopID(), llvm::makePostTransformationMetadata(), llvm::MDBuilder::mergeCallbackEncodings(), llvm::LocationMetadata::parse(), rangeMetadataExcludesValue(), llvm::Loop::setLoopID(), setOperand(), llvm::AAMDNodes::shiftTBAAStruct(), llvm::Instruction::swapProfMetadata(), unrollAndJamCountPragmaValue(), unrollCountPragmaValue(), updateLoopMetadataDebugLocationsImpl(), llvm::UpgradeTBAANode(), and llvm::TBAAVerifier::visitTBAAMetadata().
|
inlineprotected |
Definition at line 1130 of file Metadata.h.
Referenced by isResolved(), and storeDistinctInContext().
Definition at line 1193 of file Metadata.h.
References assert(), getNumOperands(), and I.
Referenced by llvm::AbstractCallSite::AbstractCallSite(), AccessQualFromMD(), llvm::DwarfUnit::addAnnotation(), AddRuntimeUnrollDisableMetaData(), ArgTypeFromMD(), llvm::cacheAnnotationFromMD(), checkMDProf(), llvm::computeKnownBitsFromRangeMetadata(), llvm::ConstantFoldTerminator(), llvm::MDBuilder::createMutableTBAAAccessTag(), llvm::MachineInstr::emitError(), llvm::findOptionMDForLoopID(), llvm::findStringMetadataForLoop(), GetBranchWeights(), llvm::AbstractCallSite::getCallbackUses(), llvm::getConstantRangeFromMetadata(), llvm::GenericDINode::getDwarfOperand(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeAttributes(), llvm::Function::getEntryCount(), llvm::FPMathOperator::getFPAccuracy(), llvm::ProfileSummary::getFromMD(), getLinkedToSymbol(), getLocCookie(), llvm::Loop::getLoopID(), llvm::DINode::getOperandAs(), llvm::DIMacroNode::getOperandAs(), llvm::getOptionalBoolLoopAttribute(), getOptionalVal(), llvm::DICompositeType::getRawAllocated(), llvm::DICompositeType::getRawAnnotations(), llvm::DIGlobalVariable::getRawAnnotations(), llvm::DILocalVariable::getRawAnnotations(), llvm::DICompositeType::getRawAssociated(), llvm::DICompositeType::getRawBaseType(), llvm::DIGenericSubrange::getRawCountNode(), llvm::DICompositeType::getRawDataLocation(), llvm::DICommonBlock::getRawDecl(), llvm::DICompositeType::getRawDiscriminator(), llvm::DICompositeType::getRawElements(), llvm::DIMacroFile::getRawElements(), llvm::DICompileUnit::getRawEnumTypes(), llvm::DIGlobalVariableExpression::getRawExpression(), llvm::DIScope::getRawFile(), llvm::DIVariable::getRawFile(), llvm::DICommonBlock::getRawFile(), llvm::DILabel::getRawFile(), llvm::DIObjCProperty::getRawFile(), llvm::DIMacroFile::getRawFile(), llvm::DICompileUnit::getRawGlobalVariables(), llvm::DICompileUnit::getRawImportedEntities(), llvm::DILocation::getRawInlinedAt(), llvm::DIGenericSubrange::getRawLowerBound(), llvm::DICompileUnit::getRawMacros(), llvm::DICompositeType::getRawRank(), llvm::DICompileUnit::getRawRetainedTypes(), llvm::DIType::getRawScope(), llvm::DILocation::getRawScope(), llvm::DILexicalBlockBase::getRawScope(), llvm::DINamespace::getRawScope(), llvm::DIVariable::getRawScope(), llvm::DICommonBlock::getRawScope(), llvm::DILabel::getRawScope(), llvm::DIGlobalVariable::getRawStaticDataMemberDeclaration(), llvm::DIGenericSubrange::getRawStride(), llvm::DIStringType::getRawStringLength(), llvm::DIStringType::getRawStringLengthExp(), llvm::DIStringType::getRawStringLocationExp(), llvm::DICompositeType::getRawTemplateParams(), llvm::DIGlobalVariable::getRawTemplateParams(), llvm::DITemplateParameter::getRawType(), llvm::DIVariable::getRawType(), llvm::DIObjCProperty::getRawType(), llvm::DISubroutineType::getRawTypeArray(), llvm::DIGenericSubrange::getRawUpperBound(), llvm::DIGlobalVariableExpression::getRawVariable(), llvm::DICompositeType::getRawVTableHolder(), getSummaryFromMD(), llvm::GetUnrollMetadata(), getValMD(), llvm::DITemplateValueParameter::getValue(), llvm::getValueProfDataFromInst(), hasAnyUnrollPragma(), HasBranchWeights(), llvm::SwitchInstProfUpdateWrapper::init(), isKeyValuePair(), AliasScopeTracker::isNoAliasScopeDeclDead(), IsScalarTBAANodeImpl(), isStructPathTBAA(), isTBAAVtableAccess(), llvm::Module::isValidModuleFlag(), loadDXILValidatorVersion(), llvm::makeFollowupLoopID(), llvm::makePostTransformationMetadata(), llvm::MDBuilder::mergeCallbackEncodings(), llvm::LocationMetadata::parse(), rangeMetadataExcludesValue(), replaceOperandWith(), llvm::Loop::setLoopID(), llvm::AAMDNodes::shiftTBAAStruct(), llvm::Instruction::swapProfMetadata(), unrollAndJamCountPragmaValue(), unrollCountPragmaValue(), updateLoopMetadataDebugLocationsImpl(), llvm::UpgradeTBAANode(), and llvm::TBAAVerifier::visitTBAAMetadata().
|
inlinestatic |
Definition at line 1301 of file Metadata.h.
References Context, and llvm::MDTuple::getTemporary().
Referenced by llvm::DIBuilder::createReplaceableCompositeType(), llvm::DIBuilder::createTempFunctionFwdDecl(), llvm::DIBuilder::createTempGlobalVariableFwdDecl(), and llvm::DIBuilder::createTempMacroFile().
Definition at line 960 of file Metadata.cpp.
References B, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::getArrayRef(), getOrSelfReference(), and llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::remove_if().
Referenced by llvm::combineMetadata(), llvm::AAMDNodes::concat(), llvm::AAMDNodes::merge(), and llvm::propagateMetadata().
|
inline |
Definition at line 1039 of file Metadata.h.
References llvm::Metadata::Distinct, and llvm::Metadata::Storage.
Referenced by llvm::DIType::mutate().
|
inline |
Check if node is fully resolved.
If isTemporary(), this always returns false
; if isDistinct(), this always returns true
.
If isUniqued(), returns true
if this has already dropped RAUW support (because all operands are resolved).
As forward declarations are resolved, their containers should get resolved automatically. However, if this (or one of its operands) is involved in a cycle, resolveCycles() needs to be called explicitly.
Definition at line 1036 of file Metadata.h.
References getNumUnresolved(), and isTemporary().
Referenced by resolve(), resolveCycles(), and storeDistinctInContext().
bool MDNode::isTBAAVtableAccess | ( | ) | const |
Check whether MDNode is a vtable access.
Definition at line 453 of file TypeBasedAliasAnalysis.cpp.
References getNumOperands(), getOperand(), and isStructPathTBAA().
|
inline |
Definition at line 1040 of file Metadata.h.
References llvm::Metadata::Storage, and llvm::Metadata::Temporary.
Referenced by llvm::DIBuilder::finalizeSubprogram(), isResolved(), and replaceAllUsesWith().
|
inline |
Definition at line 1038 of file Metadata.h.
References llvm::Metadata::Storage, and llvm::Metadata::Uniqued.
Referenced by llvm::DIArgList::handleChangedOperand(), MDNode(), replaceOperandWith(), resolve(), and setOperand().
|
inlineprotected |
Definition at line 989 of file Metadata.h.
Referenced by mutable_operands(), op_begin(), replaceOperandWith(), and setOperand().
|
inlineprotected |
Definition at line 990 of file Metadata.h.
Referenced by mutable_operands(), and op_end().
|
inlineprotected |
Definition at line 994 of file Metadata.h.
References mutable_begin(), and mutable_end().
|
inline |
Definition at line 1183 of file Metadata.h.
References mutable_begin().
Referenced by llvm::GenericDINode::dwarf_op_begin(), and operands().
|
inline |
Definition at line 1187 of file Metadata.h.
References mutable_end().
Referenced by llvm::GenericDINode::dwarf_op_end(), and operands().
|
inline |
Definition at line 1191 of file Metadata.h.
References op_begin(), and op_end().
Referenced by llvm::AbstractCallSite::AbstractCallSite(), addLoopMetadata(), addToAccessGroupList(), annotateFunctionWithHashMismatch(), llvm::TargetLoweringObjectFile::emitCGProfileMetadata(), llvm::AAMDNodes::extendToTBAA(), llvm::AbstractCallSite::getCallbackUses(), getSummaryFromMD(), hasInstrProfHashMismatch(), llvm::Loop::isAnnotatedParallel(), llvm::makeFollowupLoopID(), and resolveCycles().
|
inlineprotected |
Required by std, but never called.
Definition at line 978 of file Metadata.h.
References llvm_unreachable.
|
inlineprotected |
Required by std, but never called.
Definition at line 983 of file Metadata.h.
References llvm_unreachable.
|
protected |
Definition at line 536 of file Metadata.cpp.
|
protected |
Definition at line 526 of file Metadata.cpp.
References llvm::alignTo(), llvm::getAllocSize(), and H.
void MDNode::printTree | ( | raw_ostream & | OS, |
const Module * | M = nullptr |
||
) | const |
Print in tree shape.
Prints definition of this
in tree shape.
If M
is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.
Definition at line 4790 of file AsmWriter.cpp.
References M, and printMetadataImpl().
Referenced by dumpTree().
void MDNode::printTree | ( | raw_ostream & | OS, |
ModuleSlotTracker & | MST, | ||
const Module * | M = nullptr |
||
) | const |
Definition at line 4796 of file AsmWriter.cpp.
References M, and printMetadataImpl().
|
inline |
RAUW a temporary.
true
. Definition at line 1045 of file Metadata.h.
References assert(), Context, and isTemporary().
void MDNode::replaceOperandWith | ( | unsigned | I, |
Metadata * | New | ||
) |
Replace a specific operand.
Definition at line 909 of file Metadata.cpp.
References getOperand(), I, isUniqued(), mutable_begin(), and setOperand().
Referenced by addLoopMetadata(), AddRuntimeUnrollDisableMetaData(), llvm::MDBuilder::createAnonymousAARoot(), DisableAllLoopOptsOnLoop(), llvm::makeFollowupLoopID(), llvm::makePostTransformationMetadata(), llvm::GenericDINode::replaceDwarfOperandWith(), llvm::DICompositeType::replaceElements(), llvm::DIMacroFile::replaceElements(), llvm::DICompileUnit::replaceEnumTypes(), llvm::DICompileUnit::replaceGlobalVariables(), llvm::DICompileUnit::replaceImportedEntities(), llvm::DICompileUnit::replaceMacros(), llvm::DICompileUnit::replaceRetainedTypes(), llvm::DICompositeType::replaceTemplateParams(), llvm::DICompositeType::replaceVTableHolder(), and updateLoopMetadataDebugLocationsImpl().
|
inlinestatic |
Replace a temporary node with a distinct one.
Create a distinct version of N
– in place, if possible – and return it. Takes ownership of the temporary node.
Definition at line 1090 of file Metadata.h.
References N.
Referenced by llvm::DIBuilder::createArtificialSubprogram().
|
inlinestatic |
Replace a temporary node with a permanent one.
Try to create a uniqued version of N
– in place, if possible – and return it. If N
cannot be uniqued, return a distinct node instead.
Definition at line 1068 of file Metadata.h.
References N.
|
inlinestatic |
Replace a temporary node with a uniqued one.
Create a uniqued version of N
– in place, if possible – and return it. Takes ownership of the temporary node.
Definition at line 1080 of file Metadata.h.
References N.
Referenced by createTypeWithFlags(), and llvm::DIBuilder::replaceTemporary().
void MDNode::resolve | ( | ) |
Resolve a unique, unresolved node.
Definition at line 627 of file Metadata.cpp.
References assert(), isResolved(), isUniqued(), and setNumUnresolved().
Referenced by resolveCycles().
void MDNode::resolveCycles | ( | ) |
Resolve cycles.
Once all forward declarations have been resolved, force cycles to be resolved.
Definition at line 673 of file Metadata.cpp.
References assert(), isResolved(), N, operands(), and resolve().
|
inlineprotected |
|
protected |
Set an operand.
Sets the operand directly, without worrying about uniquing.
Definition at line 921 of file Metadata.cpp.
References assert(), getNumOperands(), I, isUniqued(), mutable_begin(), and llvm::MDOperand::reset().
Referenced by dropAllReferences(), MDNode(), and replaceOperandWith().
|
protected |
Definition at line 887 of file Metadata.cpp.
References assert(), Context, llvm::Metadata::Distinct, llvm::LLVMContextImpl::DistinctMDNodes, getContext(), llvm::Metadata::getMetadataID(), getNumUnresolved(), isResolved(), llvm_unreachable, llvm::LLVMContext::pImpl, and llvm::Metadata::Storage.
Referenced by llvm::DIArgList::handleChangedOperand().
|
staticprotected |
Definition at line 28 of file MetadataImpl.h.
References llvm::Metadata::Distinct, llvm_unreachable, N, llvm::Metadata::Storage, T, llvm::Metadata::Temporary, and llvm::Metadata::Uniqued.
|
staticprotected |
Definition at line 42 of file MetadataImpl.h.
References llvm::Metadata::Distinct, N, llvm::Metadata::Storage, llvm::SPII::Store, T, llvm::Metadata::Temporary, and llvm::Metadata::Uniqued.
|
friend |
Definition at line 929 of file Metadata.h.
|
friend |
Definition at line 928 of file Metadata.h.
|
friend |
Definition at line 927 of file Metadata.h.