LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Friends | List of all members
llvm::NamedMDNode Class Reference

A tuple of MDNodes. More...

#include "llvm/IR/Metadata.h"

Inheritance diagram for llvm::NamedMDNode:
Inheritance graph
[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
 
 ~NamedMDNode ()
 
void eraseFromParent ()
 Drop all references and remove the node from parent module.
 
void dropAllReferences ()
 Remove all uses and clear node vector.
 
void clearOperands ()
 Drop all references to this node's operands.
 
ModulegetParent ()
 Get the module that holds this named metadata collection.
 
const ModulegetParent () const
 
MDNodegetOperand (unsigned i) const
 
unsigned getNumOperands () const
 
void addOperand (MDNode *M)
 
void setOperand (unsigned I, MDNode *New)
 
StringRef getName () const
 
void print (raw_ostream &ROS, bool IsForDebug=false) const
 
void print (raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug=false) const
 
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< OptionsT >
self_iterator getIterator ()
 
const_self_iterator getIterator () const
 
reverse_self_iterator getReverseIterator ()
 
const_reverse_self_iterator getReverseIterator () const
 
bool isSentinel () const
 Check whether this is the sentinel node.
 
- Public Member Functions inherited from llvm::ilist_detail::node_parent_access< ilist_node_impl< OptionsT >, OptionsT::parent_ty >
const OptionsT::parent_ty * getParent () const
 
OptionsT::parent_ty * getParent ()
 
void setParent (OptionsT::parent_ty *Parent)
 

Friends

class LLVMContextImpl
 
class Module
 

Additional Inherited Members

- Protected Types inherited from llvm::ilist_node_impl< OptionsT >
using self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type
 
using const_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, true >::type
 
using reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, false >::type
 
using const_reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, true >::type
 
- Protected Member Functions inherited from llvm::ilist_node_impl< OptionsT >
 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 1730 of file Metadata.h.

Member Typedef Documentation

◆ const_op_iterator

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

Definition at line 1821 of file Metadata.h.

◆ op_iterator

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

Definition at line 1816 of file Metadata.h.

Constructor & Destructor Documentation

◆ NamedMDNode()

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

◆ ~NamedMDNode()

NamedMDNode::~NamedMDNode ( )

Definition at line 1379 of file Metadata.cpp.

References dropAllReferences(), and getNMDOps().

Member Function Documentation

◆ addOperand()

void NamedMDNode::addOperand ( MDNode M)

◆ clearOperands()

void NamedMDNode::clearOperands ( )

Drop all references to this node's operands.

Definition at line 1403 of file Metadata.cpp.

References getNMDOps().

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

◆ dropAllReferences()

void llvm::NamedMDNode::dropAllReferences ( )
inline

Remove all uses and clear node vector.

Definition at line 1795 of file Metadata.h.

References clearOperands().

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

◆ dump()

LLVM_DUMP_METHOD void NamedMDNode::dump ( ) const

Definition at line 5296 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 1401 of file Metadata.cpp.

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

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

◆ getName()

StringRef NamedMDNode::getName ( ) const

◆ getNumOperands()

unsigned NamedMDNode::getNumOperands ( ) const

◆ getOperand()

MDNode * NamedMDNode::getOperand ( unsigned  i) const

◆ getParent() [1/2]

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

Get the module that holds this named metadata collection.

Definition at line 1800 of file Metadata.h.

Referenced by eraseFromParent(), LLVMGetNextNamedMetadata(), LLVMGetPreviousNamedMetadata(), print(), and llvm::dxil::ValidatorVersionMD::update().

◆ getParent() [2/2]

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

Definition at line 1801 of file Metadata.h.

◆ op_begin() [1/2]

op_iterator llvm::NamedMDNode::op_begin ( )
inline

Definition at line 1818 of file Metadata.h.

Referenced by operands().

◆ op_begin() [2/2]

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

Definition at line 1823 of file Metadata.h.

◆ op_end() [1/2]

op_iterator llvm::NamedMDNode::op_end ( )
inline

Definition at line 1819 of file Metadata.h.

References getNumOperands().

Referenced by operands().

◆ op_end() [2/2]

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

Definition at line 1824 of file Metadata.h.

References getNumOperands().

◆ operands() [1/2]

iterator_range< op_iterator > llvm::NamedMDNode::operands ( )
inline

◆ operands() [2/2]

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

Definition at line 1829 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 4883 of file AsmWriter.cpp.

References getParent(), and OS.

Referenced by dump().

◆ print() [2/2]

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

Definition at line 4890 of file AsmWriter.cpp.

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

◆ setOperand()

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

Friends And Related Function Documentation

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 1731 of file Metadata.h.

◆ Module

friend class Module
friend

Definition at line 1732 of file Metadata.h.


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