LLVM  14.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
llvm::MDNode Class Reference

Metadata node. More...

#include "llvm/IR/Metadata.h"

Inheritance diagram for llvm::MDNode:
Inheritance graph
[legend]
Collaboration diagram for llvm::MDNode:
Collaboration graph
[legend]

Classes

struct  HasCachedHash
 

Public Types

using op_iterator = const MDOperand *
 
using op_range = iterator_range< op_iterator >
 

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...
 
LLVMContextgetContext () 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 MDOperandgetOperand (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
 

Static Public Member Functions

static MDTupleget (LLVMContext &Context, ArrayRef< Metadata * > MDs)
 
static MDTuplegetIfExists (LLVMContext &Context, ArrayRef< Metadata * > MDs)
 
static MDTuplegetDistinct (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 MDNodeconcatenate (MDNode *A, MDNode *B)
 Methods for metadata merging. More...
 
static MDNodeintersect (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericTBAA (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericFPMath (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericRange (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericAliasScope (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericAlignmentOrDereferenceable (MDNode *A, MDNode *B)
 

Protected Types

using mutable_op_range = iterator_range< MDOperand * >
 
 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)
 
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 ()
 
MDOperandmutable_begin ()
 
MDOperandmutable_end ()
 
mutable_op_range mutable_operands ()
 
void setOperand (unsigned I, Metadata *New)
 Set an operand. More...
 
void storeDistinctInContext ()
 

Static Protected Member Functions

template<class T , class StoreT >
static TstoreImpl (T *N, StorageType Storage, StoreT &Store)
 
template<class T >
static TstoreImpl (T *N, StorageType Storage)
 

Friends

class ReplaceableMetadataImpl
 
class LLVMContextImpl
 
class DIArgList
 

Additional Inherited Members

Detailed Description

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 906 of file Metadata.h.

Member Typedef Documentation

◆ mutable_op_range

Definition at line 939 of file Metadata.h.

◆ op_iterator

Definition at line 1124 of file Metadata.h.

◆ op_range

Definition at line 1125 of file Metadata.h.

Constructor & Destructor Documentation

◆ MDNode() [1/2]

MDNode::MDNode ( LLVMContext Context,
unsigned  ID,
StorageType  Storage,
ArrayRef< Metadata * >  Ops1,
ArrayRef< Metadata * >  Ops2 = None 
)
protected

Definition at line 525 of file Metadata.cpp.

References isUniqued(), and setOperand().

◆ ~MDNode()

llvm::MDNode::~MDNode ( )
protecteddefault

◆ MDNode() [2/2]

llvm::MDNode::MDNode ( const MDNode )
delete

Member Function Documentation

◆ classof()

static bool llvm::MDNode::classof ( const Metadata MD)
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast:

Definition at line 1146 of file Metadata.h.

References llvm::Metadata::getMetadataID().

◆ clone()

TempMDNode MDNode::clone ( ) const

Create a (temporary) clone of this.

Definition at line 543 of file Metadata.cpp.

References llvm::Metadata::getMetadataID(), and llvm_unreachable.

Referenced by llvm::DIType::clone().

◆ concatenate()

MDNode * MDNode::concatenate ( MDNode A,
MDNode B 
)
static

◆ deleteTemporary()

void MDNode::deleteTemporary ( MDNode N)
static

Deallocate a node created by getTemporary.

Calls replaceAllUsesWith(nullptr) before deleting, so any remaining references will be reset.

Definition at line 849 of file Metadata.cpp.

References assert(), and N.

Referenced by LLVMDisposeTemporaryMDNode(), and llvm::TempMDNodeDeleter::operator()().

◆ dropAllReferences()

void MDNode::dropAllReferences ( )
protected

Definition at line 708 of file Metadata.cpp.

References Context, E, I, and setOperand().

◆ dumpTree() [1/2]

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 4868 of file AsmWriter.cpp.

◆ dumpTree() [2/2]

LLVM_DUMP_METHOD void MDNode::dumpTree ( const Module M) const

Definition at line 4871 of file AsmWriter.cpp.

References llvm::dbgs(), M, and printTree().

◆ get()

MDTuple * llvm::MDNode::get ( LLVMContext Context,
ArrayRef< Metadata * >  MDs 
)
inlinestatic

Definition at line 1233 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(), avoidZeroOffsetLandingPad(), canonicalizeMetadataForValue(), ScopedAliasMetadataDeepCloner::clone(), 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::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(), TransferTracker::emitMOLoc(), 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(), llvm::SimpleLoopUnswitchPass::run(), runOnFunction(), llvm::LoopVectorizeHints::setAlreadyVectorized(), SCEVDbgValueBuilder::setFinalExpression(), llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopMustProgress(), setNoClobberMetadata(), setUniformMetadata(), llvm::GlobalObject::setVCallVisibilityMetadata(), llvm::AAMDNodes::shiftTBAAStruct(), splitGlobal(), llvm::Instruction::swapProfMetadata(), transferSRADebugInfo(), TryToShrinkGlobalToBoolean(), llvm::uniteAccessGroups(), llvm::OpenMPIRBuilder::unrollLoopFull(), llvm::OpenMPIRBuilder::unrollLoopHeuristic(), llvm::OpenMPIRBuilder::unrollLoopPartial(), llvm::CallInst::updateProfWeight(), llvm::UpgradeModuleFlags(), llvm::UpgradeTBAANode(), and llvm::InstCombinerImpl::visitCallInst().

◆ getContext()

LLVMContext& llvm::MDNode::getContext ( ) const
inline

◆ getDistinct()

MDTuple * llvm::MDNode::getDistinct ( LLVMContext Context,
ArrayRef< Metadata * >  MDs 
)
inlinestatic

◆ getIfExists()

MDTuple * llvm::MDNode::getIfExists ( LLVMContext Context,
ArrayRef< Metadata * >  MDs 
)
inlinestatic

Definition at line 1237 of file Metadata.h.

References Context, and llvm::MDTuple::getIfExists().

◆ getMostGenericAliasScope()

MDNode * MDNode::getMostGenericAliasScope ( MDNode A,
MDNode B 
)
static

◆ getMostGenericAlignmentOrDereferenceable()

MDNode * MDNode::getMostGenericAlignmentOrDereferenceable ( MDNode A,
MDNode B 
)
static

Definition at line 1093 of file Metadata.cpp.

References B, and llvm::ConstantInt::getZExtValue().

Referenced by llvm::combineMetadata().

◆ getMostGenericFPMath()

MDNode * MDNode::getMostGenericFPMath ( MDNode A,
MDNode B 
)
static

Definition at line 973 of file Metadata.cpp.

References B.

Referenced by llvm::combineMetadata(), and llvm::propagateMetadata().

◆ getMostGenericRange()

MDNode * MDNode::getMostGenericRange ( MDNode A,
MDNode B 
)
static

◆ getMostGenericTBAA()

MDNode * MDNode::getMostGenericTBAA ( MDNode A,
MDNode B 
)
static

◆ getNumOperands()

unsigned llvm::MDNode::getNumOperands ( ) const
inline

Return number of MDNode operands.

Definition at line 1143 of file Metadata.h.

Referenced by llvm::AbstractCallSite::AbstractCallSite(), AddRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), addToAccessGroupList(), llvm::cacheAnnotationFromMD(), checkMDProf(), llvm::computeKnownBitsFromRangeMetadata(), llvm::ConstantFoldTerminator(), createAccessTag(), llvm::MachineInstr::emitError(), llvm::findOptionMDForLoopID(), llvm::findStringMetadataForLoop(), GetBranchWeights(), llvm::getConstantRangeFromMetadata(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeAttributes(), llvm::ProfileSummary::getFromMD(), getLocCookie(), llvm::Loop::getLoopID(), llvm::GenericDINode::getNumDwarfOperands(), 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(), llvm::makeFollowupLoopID(), llvm::makePostTransformationMetadata(), llvm::MDBuilder::mergeCallbackEncodings(), llvm::LocationMetadata::parse(), rangeMetadataExcludesValue(), llvm::Loop::setLoopID(), llvm::AAMDNodes::shiftTBAAStruct(), llvm::Instruction::swapProfMetadata(), unrollAndJamCountPragmaValue(), unrollCountPragmaValue(), updateLoopMetadataDebugLocationsImpl(), llvm::UpgradeTBAANode(), and llvm::TBAAVerifier::visitTBAAMetadata().

◆ getOperand()

const MDOperand& llvm::MDNode::getOperand ( unsigned  I) const
inline

Definition at line 1137 of file Metadata.h.

References assert(), I, and op_begin().

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::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(), 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().

◆ getTemporary()

TempMDTuple llvm::MDNode::getTemporary ( LLVMContext Context,
ArrayRef< Metadata * >  MDs 
)
inlinestatic

◆ intersect()

MDNode * MDNode::intersect ( MDNode A,
MDNode B 
)
static

◆ isDistinct()

bool llvm::MDNode::isDistinct ( ) const
inline

Definition at line 986 of file Metadata.h.

References llvm::Metadata::Distinct, and llvm::Metadata::Storage.

Referenced by llvm::DIType::mutate().

◆ isResolved()

bool llvm::MDNode::isResolved ( ) const
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 983 of file Metadata.h.

References isTemporary().

Referenced by resolve(), resolveCycles(), and storeDistinctInContext().

◆ isTBAAVtableAccess()

bool MDNode::isTBAAVtableAccess ( ) const

Check whether MDNode is a vtable access.

Definition at line 454 of file TypeBasedAliasAnalysis.cpp.

References getNumOperands(), getOperand(), and isStructPathTBAA().

◆ isTemporary()

bool llvm::MDNode::isTemporary ( ) const
inline

◆ isUniqued()

bool llvm::MDNode::isUniqued ( ) const
inline

◆ mutable_begin()

MDOperand* llvm::MDNode::mutable_begin ( )
inlineprotected

Definition at line 936 of file Metadata.h.

References mutable_end().

Referenced by mutable_operands(), op_begin(), replaceOperandWith(), and setOperand().

◆ mutable_end()

MDOperand* llvm::MDNode::mutable_end ( )
inlineprotected

Definition at line 937 of file Metadata.h.

Referenced by mutable_begin(), mutable_operands(), and op_end().

◆ mutable_operands()

mutable_op_range llvm::MDNode::mutable_operands ( )
inlineprotected

Definition at line 941 of file Metadata.h.

References mutable_begin(), and mutable_end().

◆ op_begin()

op_iterator llvm::MDNode::op_begin ( ) const
inline

Definition at line 1127 of file Metadata.h.

References mutable_begin().

Referenced by llvm::GenericDINode::dwarf_op_begin(), getOperand(), and operands().

◆ op_end()

op_iterator llvm::MDNode::op_end ( ) const
inline

Definition at line 1131 of file Metadata.h.

References mutable_end().

Referenced by llvm::GenericDINode::dwarf_op_end(), and operands().

◆ operands()

op_range llvm::MDNode::operands ( ) const
inline

◆ operator delete() [1/3]

void llvm::MDNode::operator delete ( void *  ,
unsigned   
)
inlineprotected

Required by std, but never called.

Definition at line 925 of file Metadata.h.

References llvm_unreachable.

◆ operator delete() [2/3]

void llvm::MDNode::operator delete ( void *  ,
unsigned  ,
bool   
)
inlineprotected

Required by std, but never called.

Definition at line 930 of file Metadata.h.

References llvm_unreachable.

◆ operator delete() [3/3]

LLVM_NO_SANITIZE_MEMORY_ATTRIBUTE void MDNode::operator delete ( void *  Mem)
protected

Definition at line 514 of file Metadata.cpp.

References llvm::alignTo(), E, N, and llvm::RISCVFenceField::O.

◆ operator new() [1/2]

void * MDNode::operator new ( size_t  Size,
unsigned  NumOps 
)
protected

Definition at line 500 of file Metadata.cpp.

References llvm::alignTo(), E, llvm::RISCVFenceField::O, and llvm::Check::Size.

◆ operator new() [2/2]

void* llvm::MDNode::operator new ( size_t  )
delete

◆ operator=()

void llvm::MDNode::operator= ( const MDNode )
delete

◆ printTree() [1/2]

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 4804 of file AsmWriter.cpp.

References M, and printMetadataImpl().

Referenced by dumpTree().

◆ printTree() [2/2]

void MDNode::printTree ( raw_ostream OS,
ModuleSlotTracker MST,
const Module M = nullptr 
) const

Definition at line 4810 of file AsmWriter.cpp.

References M, and printMetadataImpl().

◆ replaceAllUsesWith()

void llvm::MDNode::replaceAllUsesWith ( Metadata MD)
inline

RAUW a temporary.

Precondition
isTemporary() must be true.

Definition at line 992 of file Metadata.h.

References assert(), Context, and isTemporary().

Referenced by ScopedAliasMetadataDeepCloner::clone().

◆ replaceOperandWith()

void MDNode::replaceOperandWith ( unsigned  I,
Metadata New 
)

◆ replaceWithDistinct()

template<class T >
static std::enable_if_t<std::is_base_of<MDNode, T>::value, T *> llvm::MDNode::replaceWithDistinct ( std::unique_ptr< T, TempMDNodeDeleter N)
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 1037 of file Metadata.h.

References N.

Referenced by llvm::DIBuilder::createArtificialSubprogram().

◆ replaceWithPermanent()

template<class T >
static std::enable_if_t<std::is_base_of<MDNode, T>::value, T *> llvm::MDNode::replaceWithPermanent ( std::unique_ptr< T, TempMDNodeDeleter N)
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 1015 of file Metadata.h.

References N.

◆ replaceWithUniqued()

template<class T >
static std::enable_if_t<std::is_base_of<MDNode, T>::value, T *> llvm::MDNode::replaceWithUniqued ( std::unique_ptr< T, TempMDNodeDeleter 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.

Precondition
N does not self-reference.

Definition at line 1027 of file Metadata.h.

References N.

Referenced by createTypeWithFlags(), and llvm::DIBuilder::replaceTemporary().

◆ resolve()

void MDNode::resolve ( )

Resolve a unique, unresolved node.

Definition at line 597 of file Metadata.cpp.

References assert(), isResolved(), and isUniqued().

Referenced by resolveCycles().

◆ resolveCycles()

void MDNode::resolveCycles ( )

Resolve cycles.

Once all forward declarations have been resolved, force cycles to be resolved.

Precondition
No operands (or operands' operands, etc.) have isTemporary().

Definition at line 642 of file Metadata.cpp.

References assert(), isResolved(), N, operands(), and resolve().

◆ setOperand()

void MDNode::setOperand ( unsigned  I,
Metadata New 
)
protected

Set an operand.

Sets the operand directly, without worrying about uniquing.

Definition at line 889 of file Metadata.cpp.

References assert(), I, isUniqued(), mutable_begin(), and llvm::MDOperand::reset().

Referenced by dropAllReferences(), MDNode(), and replaceOperandWith().

◆ storeDistinctInContext()

void MDNode::storeDistinctInContext ( )
protected

◆ storeImpl() [1/2]

template<class T >
T * llvm::MDNode::storeImpl ( T N,
StorageType  Storage 
)
staticprotected

◆ storeImpl() [2/2]

template<class T , class StoreT >
T * llvm::MDNode::storeImpl ( T N,
StorageType  Storage,
StoreT &  Store 
)
staticprotected

Friends And Related Function Documentation

◆ DIArgList

friend class DIArgList
friend

Definition at line 909 of file Metadata.h.

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 908 of file Metadata.h.

◆ ReplaceableMetadataImpl

friend class ReplaceableMetadataImpl
friend

Definition at line 907 of file Metadata.h.


The documentation for this class was generated from the following files: