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

Member Typedef Documentation

◆ const_op_iterator

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

Definition at line 1822 of file Metadata.h.

◆ op_iterator

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

Definition at line 1817 of file Metadata.h.

Constructor & Destructor Documentation

◆ NamedMDNode()

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

◆ ~NamedMDNode()

NamedMDNode::~NamedMDNode ( )

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

References getNMDOps().

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

◆ dropAllReferences()

void llvm::NamedMDNode::dropAllReferences ( )
inline

Remove all uses and clear node vector.

Definition at line 1796 of file Metadata.h.

References clearOperands().

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

◆ dump()

LLVM_DUMP_METHOD void NamedMDNode::dump ( ) const

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

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

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

◆ getName()

StringRef NamedMDNode::getName ( ) const

Definition at line 1442 of file Metadata.cpp.

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

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

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

◆ getParent() [2/2]

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

Definition at line 1802 of file Metadata.h.

◆ op_begin() [1/2]

op_iterator llvm::NamedMDNode::op_begin ( )
inline

Definition at line 1819 of file Metadata.h.

Referenced by operands().

◆ op_begin() [2/2]

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

Definition at line 1824 of file Metadata.h.

◆ op_end() [1/2]

op_iterator llvm::NamedMDNode::op_end ( )
inline

Definition at line 1820 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 1825 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 1830 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 4921 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 4928 of file AsmWriter.cpp.

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

◆ setOperand()

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

Definition at line 1433 of file Metadata.cpp.

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

Referenced by llvm::UpgradeModuleFlags().

Friends And Related Function Documentation

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 1732 of file Metadata.h.

◆ Module

friend class Module
friend

Definition at line 1733 of file Metadata.h.


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