LLVM 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::ReplaceableMetadataImpl Class Reference

Shared implementation of use-lists for replaceable metadata. More...

#include "llvm/IR/Metadata.h"

Inheritance diagram for llvm::ReplaceableMetadataImpl:
Inheritance graph
[legend]

Public Types

using OwnerTy = MetadataTracking::OwnerTy
 

Public Member Functions

 ReplaceableMetadataImpl (LLVMContext &Context)
 
 ~ReplaceableMetadataImpl ()
 
LLVMContextgetContext () const
 
void replaceAllUsesWith (Metadata *MD)
 Replace all uses of this with MD.
 
SmallVector< Metadata * > getAllArgListUsers ()
 Returns the list of all DIArgList users of this.
 
SmallVector< DbgVariableRecord * > getAllDbgVariableRecordUsers ()
 Returns the list of all DbgVariableRecord users of this.
 
void resolveAllUses (bool ResolveUsers=true)
 Resolve all uses of this.
 
unsigned getNumUses () const
 

Static Public Member Functions

static void SalvageDebugInfo (const Constant &C)
 Replace all uses of the constant with Undef in debug info metadata.
 

Friends

class MetadataTracking
 

Detailed Description

Shared implementation of use-lists for replaceable metadata.

Most metadata cannot be RAUW'ed. This is a shared implementation of use-lists and associated API for the three that support it ( ValueAsMetadata, TempMDNode, and DIArgList).

Definition at line 382 of file Metadata.h.

Member Typedef Documentation

◆ OwnerTy

Definition at line 386 of file Metadata.h.

Constructor & Destructor Documentation

◆ ReplaceableMetadataImpl()

llvm::ReplaceableMetadataImpl::ReplaceableMetadataImpl ( LLVMContext Context)
inline

Definition at line 394 of file Metadata.h.

References Context.

◆ ~ReplaceableMetadataImpl()

llvm::ReplaceableMetadataImpl::~ReplaceableMetadataImpl ( )
inline

Member Function Documentation

◆ getAllArgListUsers()

SmallVector< Metadata * > ReplaceableMetadataImpl::getAllArgListUsers ( )

◆ getAllDbgVariableRecordUsers()

SmallVector< DbgVariableRecord * > ReplaceableMetadataImpl::getAllDbgVariableRecordUsers ( )

◆ getContext()

LLVMContext & llvm::ReplaceableMetadataImpl::getContext ( ) const
inline

◆ getNumUses()

unsigned llvm::ReplaceableMetadataImpl::getNumUses ( ) const
inline

◆ replaceAllUsesWith()

void ReplaceableMetadataImpl::replaceAllUsesWith ( Metadata MD)

Replace all uses of this with MD.

Replace all uses of this with MD, which is allowed to be null.

Definition at line 361 of file Metadata.cpp.

References assert(), llvm::PointerUnion< PTs >::get(), llvm::Metadata::getMetadataID(), llvm::PointerUnion< PTs >::is(), llvm_unreachable, llvm::Ref, llvm::sort(), llvm::MetadataTracking::track(), and Uses.

Referenced by llvm::DIArgList::handleChangedOperand(), and llvm::ValueAsMetadata::replaceAllUsesWith().

◆ resolveAllUses()

void ReplaceableMetadataImpl::resolveAllUses ( bool  ResolveUsers = true)

Resolve all uses of this.

Resolve all uses of this, turning off RAUW permanently. If ResolveUsers, call MDNode::resolve() on any users whose last operand is resolved.

Definition at line 414 of file Metadata.cpp.

References llvm::sort(), and Uses.

◆ SalvageDebugInfo()

void ReplaceableMetadataImpl::SalvageDebugInfo ( const Constant C)
static

Replace all uses of the constant with Undef in debug info metadata.

Definition at line 331 of file Metadata.cpp.

References llvm::CallingConv::C, Context, llvm::UndefValue::get(), llvm::ValueAsMetadata::get(), I, llvm::LLVMContext::pImpl, Uses, and llvm::LLVMContextImpl::ValuesAsMetadata.

Referenced by constantIsDead().

Friends And Related Function Documentation

◆ MetadataTracking

friend class MetadataTracking
friend

Definition at line 383 of file Metadata.h.


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