LLVM 22.0.0git
llvm::NamedMDNode Class Reference

A tuple of MDNodes. More...

#include "llvm/IR/Metadata.h"

Inheritance diagram for llvm::NamedMDNode:
[legend]

Public Types

using op_iterator = op_iterator_impl<MDNode *>
using const_op_iterator = op_iterator_impl<const MDNode *>

Public Member Functions

 NamedMDNode (const NamedMDNode &)=delete
LLVM_ABI ~NamedMDNode ()
LLVM_ABI void eraseFromParent ()
 Drop all references and remove the node from parent module.
void dropAllReferences ()
 Remove all uses and clear node vector.
LLVM_ABI void clearOperands ()
 Drop all references to this node's operands.
ModulegetParent ()
 Get the module that holds this named metadata collection.
const ModulegetParent () const
LLVM_ABI MDNodegetOperand (unsigned i) const
LLVM_ABI unsigned getNumOperands () const
LLVM_ABI void addOperand (MDNode *M)
LLVM_ABI void setOperand (unsigned I, MDNode *New)
LLVM_ABI StringRef getName () const
LLVM_ABI void print (raw_ostream &ROS, bool IsForDebug=false) const
LLVM_ABI void print (raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug=false) const
LLVM_ABI void dump () const
op_iterator op_begin ()
op_iterator op_end ()
const_op_iterator op_begin () const
const_op_iterator op_end () const
iterator_range< op_iteratoroperands ()
iterator_range< const_op_iteratoroperands () const
Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< NamedMDNode, Options... >::type >
self_iterator getIterator ()
reverse_self_iterator getReverseIterator ()
std::enable_if_t< T::is_sentinel_tracking_explicit, boolisSentinel () const
 Check whether this is the sentinel node.
Public Member Functions inherited from llvm::ilist_detail::node_parent_access< ilist_node_impl< ilist_detail::compute_node_options< NamedMDNode, Options... >::type >, ilist_detail::compute_node_options< NamedMDNode, Options... >::type::parent_ty >
const ilist_detail::compute_node_options< NamedMDNode, Options... >::type::parent_ty * getParent () const
void setParent (ilist_detail::compute_node_options< NamedMDNode, Options... >::type::parent_ty *Parent)

Friends

class LLVMContextImpl
class Module

Additional Inherited Members

Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< NamedMDNode, Options... >::type >
using self_iterator
using const_self_iterator
using reverse_self_iterator
using const_reverse_self_iterator
Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< NamedMDNode, Options... >::type >
 ilist_node_impl ()=default

Detailed Description

A tuple of MDNodes.

Despite its name, a NamedMDNode isn't itself an MDNode.

NamedMDNodes are named module-level entities that contain lists of MDNodes.

It is illegal for a NamedMDNode to appear as an operand of an MDNode.

Definition at line 1753 of file Metadata.h.

Member Typedef Documentation

◆ const_op_iterator

using llvm::NamedMDNode::const_op_iterator = op_iterator_impl<const MDNode *>

Definition at line 1844 of file Metadata.h.

◆ op_iterator

using llvm::NamedMDNode::op_iterator = op_iterator_impl<MDNode *>

Definition at line 1839 of file Metadata.h.

Constructor & Destructor Documentation

◆ NamedMDNode()

llvm::NamedMDNode::NamedMDNode ( const NamedMDNode & )
delete

References LLVM_ABI.

◆ ~NamedMDNode()

NamedMDNode::~NamedMDNode ( )

Definition at line 1456 of file Metadata.cpp.

References dropAllReferences(), and getNMDOps().

Member Function Documentation

◆ addOperand()

◆ clearOperands()

void NamedMDNode::clearOperands ( )

Drop all references to this node's operands.

Definition at line 1480 of file Metadata.cpp.

References getNMDOps().

Referenced by dropAllReferences(), emitValidatorVersionMD(), stripDeadDebugInfoImpl(), llvm::stripDebugifyMetadata(), and llvm::UpgradeNVVMAnnotations().

◆ dropAllReferences()

void llvm::NamedMDNode::dropAllReferences ( )
inline

Remove all uses and clear node vector.

Definition at line 1818 of file Metadata.h.

References clearOperands().

Referenced by handleValVerMetadata(), and ~NamedMDNode().

◆ dump()

LLVM_DUMP_METHOD void NamedMDNode::dump ( ) const

Definition at line 5497 of file AsmWriter.cpp.

References llvm::dbgs(), and print().

◆ eraseFromParent()

void NamedMDNode::eraseFromParent ( )

Drop all references and remove the node from parent module.

Definition at line 1478 of file Metadata.cpp.

References llvm::Module::eraseNamedMetadata(), and getParent().

Referenced by handleValVerMetadata(), and llvm::stripDebugifyMetadata().

◆ getName()

StringRef NamedMDNode::getName ( ) const

Definition at line 1482 of file Metadata.cpp.

Referenced by LLVMGetNamedMetadataName(), and llvm::stripNonLineTableDebugInfo().

◆ getNumOperands()

◆ getOperand()

◆ getParent() [1/2]

Module * llvm::NamedMDNode::getParent ( )
inline

Get the module that holds this named metadata collection.

Definition at line 1823 of file Metadata.h.

References Module.

Referenced by eraseFromParent(), LLVMGetNextNamedMetadata(), and LLVMGetPreviousNamedMetadata().

◆ getParent() [2/2]

const Module * llvm::NamedMDNode::getParent ( ) const
inline

Definition at line 1824 of file Metadata.h.

References Module.

◆ op_begin() [1/2]

op_iterator llvm::NamedMDNode::op_begin ( )
inline

Definition at line 1841 of file Metadata.h.

Referenced by operands(), and operands().

◆ op_begin() [2/2]

const_op_iterator llvm::NamedMDNode::op_begin ( ) const
inline

Definition at line 1846 of file Metadata.h.

◆ op_end() [1/2]

op_iterator llvm::NamedMDNode::op_end ( )
inline

Definition at line 1842 of file Metadata.h.

References getNumOperands().

Referenced by operands(), and operands().

◆ op_end() [2/2]

const_op_iterator llvm::NamedMDNode::op_end ( ) const
inline

Definition at line 1847 of file Metadata.h.

References getNumOperands().

◆ operands() [1/2]

◆ operands() [2/2]

iterator_range< const_op_iterator > llvm::NamedMDNode::operands ( ) const
inline

Definition at line 1852 of file Metadata.h.

References llvm::make_range(), op_begin(), and op_end().

◆ print() [1/2]

void NamedMDNode::print ( raw_ostream & ROS,
bool IsForDebug = false ) const

Definition at line 5084 of file AsmWriter.cpp.

References getParent().

◆ print() [2/2]

void NamedMDNode::print ( raw_ostream & ROS,
ModuleSlotTracker & MST,
bool IsForDebug = false ) const

Definition at line 5091 of file AsmWriter.cpp.

References llvm::ModuleSlotTracker::getMachine(), and getParent().

◆ setOperand()

void NamedMDNode::setOperand ( unsigned I,
MDNode * New )

Definition at line 1473 of file Metadata.cpp.

References assert(), getNMDOps(), getNumOperands(), and I.

Referenced by llvm::UpgradeModuleFlags().

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 1754 of file Metadata.h.

References LLVMContextImpl.

Referenced by LLVMContextImpl.

◆ Module

friend class Module
friend

Definition at line 1755 of file Metadata.h.

References Module.

Referenced by getParent(), getParent(), and Module.


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