LLVM  8.0.0svn
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...
 

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< std::is_base_of< MDNode, T >::value, T * >::type replaceWithPermanent (std::unique_ptr< T, TempMDNodeDeleter > N)
 Replace a temporary node with a permanent one. More...
 
template<class T >
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type replaceWithUniqued (std::unique_ptr< T, TempMDNodeDeleter > N)
 Replace a temporary node with a uniqued one. More...
 
template<class T >
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type 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
 

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

Member Typedef Documentation

◆ mutable_op_range

Definition at line 896 of file Metadata.h.

◆ op_iterator

Definition at line 1056 of file Metadata.h.

◆ op_range

Definition at line 1057 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 504 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 1078 of file Metadata.h.

References A, B, llvm::Metadata::getMetadataID(), and intersect().

◆ clone()

TempMDNode MDNode::clone ( ) const

Create a (temporary) clone of this.

Definition at line 522 of file Metadata.cpp.

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

Referenced by llvm::DIType::clone(), cloneOrBuildODR(), and wrapConstantAsMetadata().

◆ 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 831 of file Metadata.cpp.

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

Referenced by LLVMDisposeTemporaryMDNode().

◆ dropAllReferences()

void MDNode::dropAllReferences ( )
protected

◆ get()

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

Definition at line 1166 of file Metadata.h.

References llvm::MDTuple::get().

Referenced by AddAliasScopeMetadata(), llvm::Module::addModuleFlag(), AddRuntimeUnrollDisableMetaData(), llvm::LoopVersioning::annotateInstWithNoAlias(), llvm::annotateValueSite(), llvm::DIExpression::append(), buildMUBUFOffsetLoadStore(), canonicalizeMetadataForValue(), CloneAliasScopeMetadata(), llvm::DILocation::cloneWithDiscriminator(), llvm::GlobalObject::copyMetadata(), llvm::copyRangeMetadata(), createAccessTag(), llvm::MDBuilder::createAliasScope(), llvm::MDBuilder::createAliasScopeDomain(), llvm::MDBuilder::createAnonymousAARoot(), llvm::DIBuilder::createArrayType(), llvm::DIBuilder::createBasicType(), llvm::DIBuilder::createBitFieldMemberType(), llvm::MDBuilder::createBranchWeights(), llvm::MDBuilder::createCallees(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createConstantValueExpression(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), llvm::DIBuilder::createExpression(), llvm::createFalkorMarkStridedAccessesPass(), 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::createObjCARCOptPass(), llvm::DIBuilder::createObjCIVar(), llvm::DIBuilder::createObjCProperty(), llvm::createPGOFuncNameMetadata(), llvm::DIBuilder::createPointerType(), llvm::DIBuilder::createQualifiedType(), llvm::MDBuilder::createRange(), llvm::DIBuilder::createReferenceType(), llvm::createSILowerI1CopiesPass(), llvm::DIBuilder::createStaticMemberType(), createStringMetadata(), 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::createX86PadShortFunctions(), DisableAllLoopOptsOnLoop(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIRegisterInfo::eliminateFrameIndex(), emitClzero(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SIFrameLowering::emitEpilogue(), llvm::ARCFrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitPrologue(), llvm::SystemZFrameLowering::emitPrologue(), extractMDNode(), llvm::DIBuilder::finalize(), llvm::DIBuilder::finalizeSubprogram(), findBasePointer(), foldCtpop(), foldCttzCtlz(), llvm::DebugLoc::get(), llvm::DILocation::getMergedLocation(), getMostGenericRange(), getMulHu(), getNewValueJumpOpcode(), llvm::DIBuilder::getOrCreateSubrange(), llvm::DIBuilder::getOrCreateTypeArray(), getOrSelfReference(), getSubprogram(), hasOnlyUniformBranches(), INITIALIZE_PASS(), InsertReturnAddressAuth(), instrumentMaskedLoadOrStore(), isKnownTypeIdMember(), LLVMDIBuilderCreateDebugLocation(), LLVMMDNodeInContext(), llvm::SIRegisterInfo::materializeFrameBaseRegister(), llvm::LoopVersioning::prepareNoAliasMetadata(), llvm::DIExpression::prependOpcodes(), PushArgMD(), llvm::ARMTargetLowering::ReplaceNodeResults(), llvm::DIBuilder::replaceTemporary(), llvm::SIRegisterInfo::restoreSGPR(), rotateSign(), llvm::CGProfilePass::run(), llvm::WholeProgramDevirtPass::run(), selectJumpTableArmEncoding(), llvm::Loop::setLoopAlreadyUnrolled(), setNoClobberMetadata(), setUniformMetadata(), shouldInstrumentBlock(), llvm::SIRegisterInfo::spillSGPR(), splitGlobal(), StackMallocSizeClass(), llvm::StripDebugInfo(), stripDebugLocFromLoopID(), llvm::Instruction::swapProfMetadata(), transferSRADebugInfo(), TryToShrinkGlobalToBoolean(), llvm::Instruction::updateProfWeight(), llvm::UpgradeModuleFlags(), llvm::UpgradeRetainReleaseMarker(), llvm::UpgradeTBAANode(), llvm::LoopVectorizeHints::vectorizeAnalysisPassName(), and llvm::InstCombiner::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 1170 of file Metadata.h.

References llvm::MDTuple::getIfExists().

◆ getMostGenericAliasScope()

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

◆ getMostGenericAlignmentOrDereferenceable()

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

Definition at line 1050 of file Metadata.cpp.

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

Referenced by llvm::combineMetadata().

◆ getMostGenericFPMath()

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

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

Referenced by AddRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), llvm::cacheAnnotationFromMD(), checkMDProf(), CloneAliasScopeMetadata(), llvm::FunctionComparator::cmpMem(), llvm::MDNodeOpsKey::compareOps(), llvm::computeKnownBitsFromRangeMetadata(), llvm::ConstantFoldTerminator(), createAccessTag(), llvm::MDBuilder::createMutableTBAAAccessTag(), llvm::createObjCARCContractPass(), dropAllReferences(), llvm::WebAssemblyAsmPrinter::EmitEndOfAsmFile(), llvm::MachineInstr::emitError(), EmitGCCInlineAsmStr(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::MDTupleTypedArrayWrapper< T >::empty(), llvm::findStringMetadataForLoop(), GetBranchWeights(), llvm::getConstantRangeFromMetadata(), llvm::ProfileSummary::getFromMD(), getFunctionName(), llvm::Loop::getLoopID(), getMostGenericRange(), llvm::NamedMDNode::getOperand(), getOptimizationFlags(), getParentPad(), getSummaryFromMD(), llvm::GetUnrollMetadata(), getVal(), llvm::getValueProfDataFromInst(), isContiguous(), isFuncOrArgAttr(), isKeyValuePair(), isKnownTypeIdMember(), isNewFormatTBAATypeNode(), IsRootTBAANode(), IsScalarTBAANodeImpl(), isStructPathTBAA(), llvm::LTOModule::makeBuffer(), llvm::DebugInfoFinder::processValue(), rangeMetadataExcludesValue(), setBranchWeights(), llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopID(), llvm::NamedMDNode::setOperand(), llvm::DITypeRefArray::size(), llvm::MDTupleTypedArrayWrapper< T >::size(), srcMgrDiagHandler(), llvm::StripDebugInfo(), llvm::Instruction::swapProfMetadata(), UnrollAndJamCountPragmaValue(), UnrollCountPragmaValue(), llvm::UpgradeModuleFlags(), llvm::UpgradeTBAANode(), llvm::LoopVectorizeHints::vectorizeAnalysisPassName(), llvm::TBAAVerifier::visitTBAAMetadata(), wrapConstantAsMetadata(), and WriteConstantInternal().

◆ getOperand()

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

Definition at line 1069 of file Metadata.h.

References assert(), and I.

Referenced by AccessQualFromMD(), AddRuntimeUnrollDisableMetaData(), ArgTypeFromMD(), llvm::cacheAnnotationFromMD(), checkMDProf(), CloneAliasScopeMetadata(), llvm::FunctionComparator::cmpMem(), llvm::computeKnownBitsFromRangeMetadata(), llvm::ConstantFoldTerminator(), llvm::MDBuilder::createMutableTBAAAccessTag(), llvm::createObjCARCContractPass(), dropAllReferences(), llvm::WebAssemblyAsmPrinter::EmitEndOfAsmFile(), llvm::MachineInstr::emitError(), EmitGCCInlineAsmStr(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::findStringMetadataForLoop(), getARClassRegisterMask(), getAssociatedSymbol(), GetBranchWeights(), llvm::getConstantRangeFromMetadata(), llvm::Function::getEntryCount(), llvm::FPMathOperator::getFPAccuracy(), llvm::ProfileSummary::getFromMD(), getFunctionName(), getIntOperandFromRegisterString(), llvm::Loop::getLoopID(), getMDNodeOperandImpl(), getMostGenericAlignmentOrDereferenceable(), getMostGenericFPMath(), getMostGenericRange(), getOptimizationFlags(), getParentPad(), getSummaryFromMD(), llvm::GetUnrollMetadata(), getVal(), llvm::getValueProfDataFromInst(), HasAnyUnrollPragma(), HasBranchWeights(), INITIALIZE_PASS(), isContiguous(), isFuncOrArgAttr(), isKeyValuePair(), isKnownTypeIdMember(), llvm::SelectionDAGISel::IsLegalToFold(), isNewFormatTBAATypeNode(), IsScalarTBAANodeImpl(), isStructPathTBAA(), llvm::LTOModule::makeBuffer(), llvm::DITypeRefArray::operator[](), llvm::MDTupleTypedArrayWrapper< T >::operator[](), rangeMetadataExcludesValue(), replaceOperandWith(), selectJumpTableArmEncoding(), setBranchWeights(), llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopID(), srcMgrDiagHandler(), llvm::Instruction::swapProfMetadata(), UnrollAndJamCountPragmaValue(), UnrollCountPragmaValue(), llvm::UpgradeModuleFlags(), llvm::UpgradeRetainReleaseMarker(), llvm::UpgradeTBAANode(), llvm::LoopVectorizeHints::vectorizeAnalysisPassName(), llvm::TBAAVerifier::visitTBAAMetadata(), and wrapConstantAsMetadata().

◆ 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

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

Referenced by llvm::DIBuilder::DIBuilder(), dropAllReferences(), llvm::DIBuilder::finalize(), forEachUser(), isOperandUnresolved(), llvm::LexicalScope::LexicalScope(), llvm::DIBuilder::replaceArrays(), llvm::DIBuilder::replaceVTableHolder(), resolve(), resolveCycles(), storeDistinctInContext(), and wrapConstantAsMetadata().

◆ isTBAAVtableAccess()

bool MDNode::isTBAAVtableAccess ( ) const

Check whether MDNode is a vtable access.

Definition at line 452 of file TypeBasedAliasAnalysis.cpp.

References B, isStructPathTBAA(), matchAccessTags(), and llvm::Tag.

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

Referenced by replaceOperandWith(), and setOperand().

◆ mutable_end()

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

Definition at line 894 of file Metadata.h.

◆ mutable_operands()

mutable_op_range llvm::MDNode::mutable_operands ( )
inlineprotected

Definition at line 898 of file Metadata.h.

References Context, and N.

Referenced by isOperandUnresolved().

◆ op_begin()

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

◆ op_end()

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

◆ operands()

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

◆ operator delete() [1/3]

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

Definition at line 493 of file Metadata.cpp.

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

◆ operator delete() [2/3]

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

Required by std, but never called.

Definition at line 882 of file Metadata.h.

References llvm_unreachable.

◆ operator delete() [3/3]

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

Required by std, but never called.

Definition at line 887 of file Metadata.h.

References llvm_unreachable.

◆ operator new() [1/2]

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

Definition at line 481 of file Metadata.cpp.

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

◆ operator new() [2/2]

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

◆ operator=()

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

◆ replaceAllUsesWith()

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

RAUW a temporary.

Precondition
isTemporary() must be true.

Definition at line 949 of file Metadata.h.

References assert().

Referenced by deleteTemporary(), hasSelfReference(), and llvm::DIBuilder::replaceTemporary().

◆ replaceOperandWith()

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

◆ replaceWithDistinct()

template<class T >
static std::enable_if<std::is_base_of<MDNode, T>::value, T *>::type 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 994 of file Metadata.h.

References llvm::Metadata::handleChangedOperand(), llvm::Ref, llvm::Metadata::Storage, and llvm::SPII::Store.

Referenced by cloneOrBuildODR(), and llvm::DIBuilder::createArtificialSubprogram().

◆ replaceWithPermanent()

template<class T >
static std::enable_if<std::is_base_of<MDNode, T>::value, T *>::type 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 972 of file Metadata.h.

◆ replaceWithUniqued()

template<class T >
static std::enable_if<std::is_base_of<MDNode, T>::value, T *>::type 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 984 of file Metadata.h.

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

◆ resolve()

void MDNode::resolve ( )

◆ 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 621 of file Metadata.cpp.

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

Referenced by llvm::DIBuilder::finalize(), and wrapConstantAsMetadata().

◆ setOperand()

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

Set an operand.

Sets the operand directly, without worrying about uniquing.

Definition at line 871 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 , class StoreT >
T * llvm::MDNode::storeImpl ( T N,
StorageType  Storage,
StoreT &  Store 
)
staticprotected

◆ storeImpl() [2/2]

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

Friends And Related Function Documentation

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 866 of file Metadata.h.

◆ ReplaceableMetadataImpl

friend class ReplaceableMetadataImpl
friend

Definition at line 865 of file Metadata.h.


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