|
LLVM 24.0.0git
|
Storage class for function-local metadata objects. More...
#include "llvm/IR/FunctionLocalMetadata.h"
Public Member Functions | |
| LLVM_ABI void | getUsedMDNodes (SmallVectorImpl< const MDNode * > &Nodes) const |
| TempMDFunctionLocalContext | clone () const |
| TempMDFunctionLocalContext | cloneImpl () const |
| bool | isNonDebug () const |
| ArrayRef< FLScope > | getScopes () const |
| ArrayRef< FLSrcLoc > | getSrcLocs () const |
| ArrayRef< FLInlinedCall > | getInlinedCalls () const |
| FLScope | getScope (FLIndex< FLScope > Idx) const |
| FLScope | getScope (FLIndex< FLScope > Idx, FLIndex< FLInlinedCall > InlinedAt) const |
| FLSrcLoc | getSrcLoc (FLIndex< FLSrcLoc > Idx) const |
| FLSrcLoc | getSrcLoc (FLIndex< FLSrcLoc > Idx, FLIndex< FLInlinedCall > InlinedAt) const |
| FLInlinedCall | getInlinedCall (FLIndex< FLInlinedCall > Idx) const |
| uint16_t | getMaxAtomGroup () const |
| void | setMaxAtomGroup (uint16_t NewAtomGroup) |
| Generally this shouldn't be called directly; prefer updateAtomGroupWaterline, including any relevant InlinedAt. | |
| uint16_t | getNewAtomGroup (FLIndex< FLInlinedCall > InlinedCallIdx) |
| void | updateAtomGroupWaterline (FLIndex< FLInlinedCall > InlinedCallIdx, uint16_t NewWaterline) |
| uint16_t | getAtomGroupWaterline (FLIndex< FLInlinedCall > InlinedCallIdx) |
| FLIndex< FLScope > | insertScope (FLScope Scope) |
Inserts a new FLScope Scope and returns its index. | |
| FLIndex< FLScope > | getOrInsertScope (FLScope Scope) |
Returns the existing index of Scope, or else inserts it and returns its new index. | |
| FLIndex< FLSrcLoc > | insertSrcLoc (FLSrcLoc SrcLoc) |
Inserts a new FLSrcLoc SrcLoc and returns its index. | |
| FLIndex< FLSrcLoc > | getOrInsertSrcLoc (FLSrcLoc SrcLoc) |
Returns the existing index of SrcLoc, or else inserts it and returns its new index. | |
| FLIndex< FLInlinedCall > | insertInlinedCall (FLInlinedCall InlinedCall, bool UniquableMayExist=true) |
Returns the existing index of a uniquable InlinedCall, or else inserts it and returns its new index. | |
| LLVM_ABI void | printShort (raw_ostream &OS, const Module *M=nullptr) const |
| Prints a shortened version of this FLContext, where only the number of entries in each storage array is printed; useful when the full contents are not needed. | |
| LLVM_ABI void | printShort (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
| Public Member Functions inherited from llvm::MDNode | |
| MDNode (const MDNode &)=delete | |
| void | operator= (const MDNode &)=delete |
| void * | operator new (size_t)=delete |
| LLVM_ABI TempMDNode | clone () const |
| Create a (temporary) clone of this. | |
| LLVMContext & | getContext () const |
| LLVM_ABI void | replaceOperandWith (unsigned I, Metadata *New) |
| Replace a specific operand. | |
| bool | isResolved () const |
| Check if node is fully resolved. | |
| bool | isUniqued () const |
| bool | isDistinct () const |
| bool | isTemporary () const |
| bool | isReplaceable () const |
| unsigned | getNumTemporaryUses () const |
| void | replaceAllUsesWith (Metadata *MD) |
| RAUW a temporary. | |
| LLVM_ABI void | resolveCycles () |
| Resolve cycles. | |
| LLVM_ABI void | resolve () |
| Resolve a unique, unresolved node. | |
| op_iterator | op_begin () const |
| op_iterator | op_end () const |
| ArrayRef< MDOperand > | operands () const |
| const MDOperand & | getOperand (unsigned I) const |
| unsigned | getNumOperands () const |
| Return number of MDNode operands. | |
| LLVM_ABI bool | isTBAAVtableAccess () const |
| Check whether MDNode is a vtable access. | |
| LLVM_ABI void | printTree (raw_ostream &OS, const Module *M=nullptr) const |
| Print in tree shape. | |
| LLVM_ABI void | printTree (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
| LLVM_ABI void | dumpTree () const |
| User-friendly dump in tree shape. | |
| LLVM_ABI void | dumpTree (const Module *M) const |
| Public Member Functions inherited from llvm::Metadata | |
| 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 uint16_t | MaxAllowedAtomGroup |
| Static Public Attributes inherited from llvm::Metadata | |
| static constexpr const unsigned | PoisonGeneratingIDs [] |
| Metadata IDs that may generate poison. | |
Friends | |
| class | LLVMContextImpl |
| class | MDNode |
| class | LLParser |
Additional Inherited Members | |
| Public Types inherited from llvm::MDNode | |
| using | op_iterator = const MDOperand * |
| using | op_range = iterator_range<op_iterator> |
| Public Types inherited from llvm::Metadata | |
| enum | MetadataKind |
| Protected Types inherited from llvm::MDNode | |
| using | mutable_op_range = iterator_range<MDOperand *> |
| Protected Types inherited from llvm::Metadata | |
| enum | StorageType { Uniqued , Distinct , Temporary } |
| Active type of storage. More... | |
| Protected Member Functions inherited from llvm::MDNode | |
| LLVM_ABI | MDNode (LLVMContext &Context, unsigned ID, StorageType Storage, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2={}) |
| ~MDNode ()=default | |
| LLVM_ABI void * | operator new (size_t Size, size_t NumOps, StorageType Storage) |
| LLVM_ABI void | operator delete (void *Mem) |
| void | operator delete (void *, unsigned) |
| Required by std, but never called. | |
| void | operator delete (void *, unsigned, bool) |
| Required by std, but never called. | |
| LLVM_ABI void | dropAllReferences () |
| MDOperand * | mutable_begin () |
| MDOperand * | mutable_end () |
| mutable_op_range | mutable_operands () |
| LLVM_ABI void | setOperand (unsigned I, Metadata *New) |
| Set an operand. | |
| unsigned | getNumUnresolved () const |
| void | setNumUnresolved (unsigned N) |
| LLVM_ABI void | storeDistinctInContext () |
| void | resize (size_t NumOps) |
| Resize the node to hold NumOps operands. | |
| 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. | |
| Static Protected Member Functions inherited from llvm::MDNode | |
| template<class T, class StoreT> | |
| static T * | storeImpl (T *N, StorageType Storage, StoreT &Store) |
| template<class T> | |
| static T * | storeImpl (T *N, StorageType Storage) |
| 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 |
Storage class for function-local metadata objects.
This is a special MDNode variation: the class benefits from being able to appear as an operand in other MDNodes, to be treated as a metadata attachment to functions, and from the generic MDNode enumeration logic. However, it holds MDNode references that are not part of the MDNode operands() array and are not tracking references (meaning it contains forward references that must be resolved separately from the generic MDNode tracking/resolution facilities), does not meaningfully support cloning, and can only ever be created as distinct, not unique or temporary. To access all MDNodes referenced from this context, use the getUsedMDNodes() function.
Definition at line 230 of file FunctionLocalMetadata.h.
Definition at line 259 of file FunctionLocalMetadata.h.
References llvm::Metadata::getMetadataID().
|
inline |
Definition at line 268 of file FunctionLocalMetadata.h.
References cloneImpl().
|
inline |
Definition at line 269 of file FunctionLocalMetadata.h.
References llvm_unreachable.
Referenced by clone().
|
inline |
Definition at line 348 of file FunctionLocalMetadata.h.
References llvm::FLIndex< IndexedType >::get(), and getMaxAtomGroup().
|
static |
Definition at line 20 of file FunctionLocalMetadata.cpp.
References llvm::Metadata::Distinct, and llvm::MDNode::storeDistinctInContext().
|
inline |
Definition at line 317 of file FunctionLocalMetadata.h.
References assert().
Referenced by llvm::FLIndex< IndexedType >::DenseMapInfo< FLIndex< IndexedType > >.
|
inline |
Definition at line 293 of file FunctionLocalMetadata.h.
Referenced by getUsedMDNodes(), printShort(), and writeMDFunctionLocalContext().
|
inline |
Definition at line 322 of file FunctionLocalMetadata.h.
References llvm::Metadata::SubclassData16.
Referenced by getAtomGroupWaterline(), getNewAtomGroup(), and updateAtomGroupWaterline().
|
inline |
Definition at line 328 of file FunctionLocalMetadata.h.
References assert(), llvm::FLIndex< IndexedType >::get(), getMaxAtomGroup(), MaxAllowedAtomGroup, and setMaxAtomGroup().
Returns the existing index of Scope, or else inserts it and returns its new index.
NB: Uses linear search, which is very inefficient, but required if we may be inserting a duplicate Scope; if performing this operation repeatedly, FLMDBuilder is significantly more efficient.
Definition at line 364 of file FunctionLocalMetadata.h.
References insertScope().
Returns the existing index of SrcLoc, or else inserts it and returns its new index.
NB: Uses linear search, which is very inefficient, but required if we may be inserting a duplicate SrcLoc; if performing this operation repeatedly, FLMDBuilder is significantly more efficient. An exception to this is if inserting a SrcLoc with DISubprogram scope, column=0, and line equal to either 0, SP->getLine(), or SP->getScopeLine(); these are inserted near the front of SrcLocs by FLMDBuilder, so can generally be retrieved quickly.
Definition at line 385 of file FunctionLocalMetadata.h.
References insertSrcLoc().
Definition at line 295 of file FunctionLocalMetadata.h.
References assert().
|
inline |
Definition at line 299 of file FunctionLocalMetadata.h.
References assert(), and llvm::FLIndex< IndexedType >::get().
Definition at line 291 of file FunctionLocalMetadata.h.
Referenced by getUsedMDNodes(), printShort(), and writeMDFunctionLocalContext().
Definition at line 306 of file FunctionLocalMetadata.h.
References assert().
|
inline |
Definition at line 310 of file FunctionLocalMetadata.h.
References assert(), and llvm::FLIndex< IndexedType >::get().
Definition at line 292 of file FunctionLocalMetadata.h.
Referenced by printShort(), and writeMDFunctionLocalContext().
| void MDFunctionLocalContext::getUsedMDNodes | ( | SmallVectorImpl< const MDNode * > & | Nodes | ) | const |
Definition at line 27 of file FunctionLocalMetadata.cpp.
References getInlinedCalls(), getScopes(), llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
inline |
Returns the existing index of a uniquable InlinedCall, or else inserts it and returns its new index.
NB: Uses linear search for uniquing, which is very inefficient; pass UniquableMayExist as false if passing an InlinedCall which is uniquable but is known to not already exist.
Definition at line 397 of file FunctionLocalMetadata.h.
References llvm::FLInlinedCall::isEquivalent(), llvm::FLInlinedCall::MaxAtomGroup, and llvm::FLInlinedCall::Uniquable.
Inserts a new FLScope Scope and returns its index.
Definition at line 355 of file FunctionLocalMetadata.h.
Referenced by getOrInsertScope().
Inserts a new FLSrcLoc SrcLoc and returns its index.
Definition at line 372 of file FunctionLocalMetadata.h.
Referenced by getOrInsertSrcLoc().
|
inline |
Definition at line 289 of file FunctionLocalMetadata.h.
References llvm::Metadata::SubclassData1.
Referenced by printShort(), and writeMDFunctionLocalContext().
| void MDFunctionLocalContext::printShort | ( | raw_ostream & | OS, |
| const Module * | M = nullptr ) const |
Prints a shortened version of this FLContext, where only the number of entries in each storage array is printed; useful when the full contents are not needed.
Definition at line 5697 of file AsmWriter.cpp.
References printShort().
Referenced by printShort().
| void MDFunctionLocalContext::printShort | ( | raw_ostream & | OS, |
| ModuleSlotTracker & | MST, | ||
| const Module * | M = nullptr ) const |
Definition at line 5702 of file AsmWriter.cpp.
References getInlinedCalls(), getScopes(), getSrcLocs(), isNonDebug(), and printMetadataImpl().
|
inline |
Generally this shouldn't be called directly; prefer updateAtomGroupWaterline, including any relevant InlinedAt.
TODO: Should this be private?
Definition at line 326 of file FunctionLocalMetadata.h.
References llvm::Metadata::SubclassData16.
Referenced by getNewAtomGroup(), and updateAtomGroupWaterline().
|
inline |
Definition at line 338 of file FunctionLocalMetadata.h.
References assert(), llvm::FLIndex< IndexedType >::get(), getMaxAtomGroup(), MaxAllowedAtomGroup, and setMaxAtomGroup().
|
friend |
Definition at line 255 of file FunctionLocalMetadata.h.
References LLParser.
Referenced by LLParser.
|
friend |
Definition at line 253 of file FunctionLocalMetadata.h.
References LLVMContextImpl.
Referenced by LLVMContextImpl.
|
friend |
|
staticconstexpr |
Definition at line 256 of file FunctionLocalMetadata.h.
Referenced by getNewAtomGroup(), and updateAtomGroupWaterline().