Metadata node.
Synopsis
Declared in <llvm/IR/Metadata.h>
class MDNode
: public Metadata
Description
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.
MDNodes can be large or small, as well as resizable or non‐resizable. Large MDNodes' operands are allocated in a separate storage vector, whereas small MDNodes' operands are co‐allocated. Distinct and temporary MDnodes are resizable, but only MDTuples support this capability.
Clients can add operands to resizable MDNodes using push_back().
Base Classes
Name |
Description |
Root of the metadata hierarchy. |
Type Aliases
Name |
Description |
Iterator over this node's operands. |
|
Range of this node's operands. |
Enums
Name |
Description |
RTTI identifiers for concrete metadata subclasses. |
Member Functions
Name |
Description |
|
Copy construction is deleted; MDNode is non‐copyable. |
|
Copy assignment is deleted; MDNode is non‐copyable. |
Create a (temporary) clone of this. |
|
|
|
|
|
Return the LLVM context that owns this node. |
|
Return the metadata kind ID for this node. |
|
Return number of MDNode operands. |
|
Return the number of uses of this temporary metadata node. |
|
Return the operand at index |
|
Return true if this node kind is always RAUW‐replaceable (e.g. DIAssignID). |
|
Return true if this node is distinct (not uniqued). |
|
Return true if this node supports RAUW replacement. |
|
Check if node is fully resolved. |
|
Check whether MDNode is a vtable access. |
|
Return true if this is a temporary (forward‐declaration) metadata node. |
|
Return true if this node is uniqued in the context. |
|
Return an iterator to the first operand. |
|
Return an iterator past the last operand. |
|
Return this node's operands as an array reference. |
|
|
Ordinary allocation is deleted; use the custom MDNode allocators. |
|
|
|
|
|
|
RAUW a temporary. |
|
Replace a specific operand. |
|
Resolve a unique, unresolved node. |
|
Resolve cycles. |
Static Member Functions
Name |
Description |
Methods for support type inquiry through isa, cast, and dyn_cast: |
|
Methods for metadata merging. Concatenate metadata nodes |
|
Deallocate a node created by getTemporary. |
|
Convert CaptureComponents to !captures metadata. The return value may be nullptr. |
|
Return a uniqued tuple metadata node with operands |
|
Return a distinct (non‐uniqued) tuple with operands |
|
Return an existing uniqued tuple for |
|
Merge alloc‐token metadata from two instructions. |
|
Merge callee‐type metadata from two instructions. |
|
Merge callsite metadata from two instructions. |
|
Merge memprof metadata from two instructions. |
|
Merge !prof metadata from two instructions. Currently only implemented with direct callsites with branch weights. |
|
Merge alias‐scope metadata, keeping scopes present in both. |
|
Merge align/dereferenceable metadata, returning the most generic bound. |
|
Merge FP‐math metadata, returning the most generic accuracy. |
|
Merge |
|
Merge noalias address‐space metadata, returning the most generic set. |
|
Merge !range metadata by taking the union of the integer intervals. |
|
Merge TBAA metadata, returning the most generic common tag. |
|
Return a temporary tuple with operands |
|
Intersect metadata nodes |
|
Replace a temporary node with a distinct one. |
|
Replace a temporary node with a permanent one. |
|
Replace a temporary node with a uniqued one. |
|
Convert !captures metadata to CaptureComponents. MD may be nullptr. |
Static Data Members
Name |
Description |
Metadata IDs that may generate poison. |
Protected Type Aliases
Name |
Description |
Range type over mutable |
Protected Enums
Name |
Description |
Active type of storage. |
Protected Member Functions
Name |
Description |
|
Construct an MDNode in |
|
Destroy this metadata node. |
Drop all references held by this metadata node. |
|
Return the number of unresolved operands in this node. |
|
Default handling of a changed operand, which asserts. |
|
Return an iterator to the first mutable operand. |
|
Return an iterator past the last mutable operand. |
|
Return a mutable range over this node's operands. |
|
Delete operators |
|
Allocate an |
|
Resize the node to hold NumOps operands. |
|
Set the number of unresolved operands in this node. |
|
Set an operand. |
|
Register this node as a distinct MDNode owned by the LLVMContext. |
Protected Static Member Functions
Name |
Description |
|
Protected Data Members
Name |
Description |
Storage flag for non‐uniqued, otherwise unowned, metadata. |
|
One bit of subclass‐specific state packed into the metadata header. |
|
Sixteen bits of subclass‐specific state packed into the metadata header. |
|
Thirty‐two bits of subclass‐specific state packed into the metadata header. |
Friends
Name |
Description |
Assignment ID linking stores to dbg.assign intrinsics. |
|
Private implementation details of |
|
Shared implementation of use‐lists for replaceable metadata. |
Non-Member Functions
Name |
Description |
Return the named unroll hint metadata operand from loop id |
|
Lookup or compute a mapping for a piece of metadata. |
|
Version of MapMetadata with type safety for MDNode. |
|
Upgrade a scalar TBAA tag to the struct‐path aware TBAA format. |
|
Compute known bits from the range metadata. |
|
Extract branch weights from MD_prof metadata |
|
Faster version of extractBranchWeights() that skips checks and must only be called with "branch_weights" metadata nodes. Supports uint32_t. |
|
Faster version of extractBranchWeights() that skips checks and must only be called with "branch_weights" metadata nodes. Supports uint64_t. |
|
Retrieve the total of all weights from MD_prof data. |
|
Find string metadata for a loop. |
|
Find and return the loop attribute node for the attribute |
|
Get the branch weights metadata node |
|
Return the offset to the first branch weight data |
|
Parse out a conservative ConstantRange from !range metadata. |
|
Find subprogram that is enclosing this scope. |
|
Returns a metadata node containing unknown branch weights if the function has an entry count, otherwise returns nullptr. |
|
Return the cache hint metadata node for a memory operand. |
|
Return the number of branch weights stored in |
|
Return the PGOFuncName metadata node associated with function |
|
Return the named unroll hint metadata node attached to loop |
|
Get the valid branch weights metadata node |
|
Check if Branch Weight Metadata has an "expected" field from an llvm.expect* intrinsic |
|
Compute the intersection of access groups on two instructions. |
|
Checks if an MDNode contains Branch Weight Metadata |
|
Check whether |
|
Return whether an MDNode might represent an access group. |
|
Checks if an MDNode contains value profiling Metadata |
|
Create a new loop identifier for a loop created from a loop transformation. |
|
Create a new LoopID after the loop has been transformed. |
|
Compute the union of two access‐group lists. |
|
Upgrade the loop attachment metadata node. |
|
Wrap a |
|
Build callstack metadata from the provided list of call stack ids. |
|
Returns the allocation type from an MIB metadata node. |
|
Returns the stack node from an MIB metadata node. |
Derived Classes
Name |
Description |
Assignment ID linking stores to dbg.assign intrinsics. |
|
DWARF expression. |
|
A pair of DIGlobalVariable and DIExpression. |
|
Debug location. |
|
Macro Info DWARF‐like metadata node. |
|
Tagged DWARF‐like metadata node. |
|
Tuple of metadata. |
Created with MrDocs