LLVM 22.0.0git
|
Shared implementation of use-lists for replaceable metadata. More...
#include "llvm/IR/Metadata.h"
Public Types | |
using | OwnerTy = MetadataTracking::OwnerTy |
Public Member Functions | |
ReplaceableMetadataImpl (LLVMContext &Context) | |
~ReplaceableMetadataImpl () | |
LLVMContext & | getContext () const |
LLVM_ABI void | replaceAllUsesWith (Metadata *MD) |
Replace all uses of this with MD. | |
LLVM_ABI SmallVector< Metadata * > | getAllArgListUsers () |
Returns the list of all DIArgList users of this. | |
LLVM_ABI SmallVector< DbgVariableRecord * > | getAllDbgVariableRecordUsers () |
Returns the list of all DbgVariableRecord users of this. | |
LLVM_ABI void | resolveAllUses (bool ResolveUsers=true) |
Resolve all uses of this. | |
unsigned | getNumUses () const |
Static Public Member Functions | |
static LLVM_ABI void | SalvageDebugInfo (const Constant &C) |
Replace all uses of the constant with Undef in debug info metadata. |
Friends | |
class | MetadataTracking |
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 389 of file Metadata.h.
Definition at line 393 of file Metadata.h.
|
inline |
Definition at line 401 of file Metadata.h.
|
inline |
Definition at line 403 of file Metadata.h.
References assert().
SmallVector< Metadata * > ReplaceableMetadataImpl::getAllArgListUsers | ( | ) |
Returns the list of all DIArgList users of this.
Definition at line 250 of file Metadata.cpp.
References llvm::cast(), llvm::Metadata::getMetadataID(), llvm::isa(), llvm::PointerUnion< PTs >::isNull(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::sort().
Referenced by llvm::ValueAsMetadata::getAllArgListUsers().
SmallVector< DbgVariableRecord * > ReplaceableMetadataImpl::getAllDbgVariableRecordUsers | ( | ) |
Returns the list of all DbgVariableRecord users of this.
Definition at line 272 of file Metadata.cpp.
References llvm::cast(), llvm::isa(), llvm::PointerUnion< PTs >::isNull(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::sort().
Referenced by llvm::DIArgList::getAllDbgVariableRecordUsers(), and llvm::ValueAsMetadata::getAllDbgVariableRecordUsers().
|
inline |
Definition at line 407 of file Metadata.h.
Referenced by llvm::ContextAndReplaceableUses::getContext(), and llvm::DIArgList::handleChangedOperand().
|
inline |
Definition at line 427 of file Metadata.h.
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 368 of file Metadata.cpp.
References assert(), llvm::cast(), llvm::dyn_cast(), llvm::Metadata::getMetadataID(), llvm::isa(), llvm_unreachable, llvm::Ref, llvm::sort(), llvm::MetadataTracking::track(), and Uses.
Referenced by llvm::DIArgList::handleChangedOperand(), and llvm::ValueAsMetadata::replaceAllUsesWith().
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 421 of file Metadata.cpp.
References llvm::cast(), llvm::dyn_cast_if_present(), llvm::isa(), llvm::sort(), and Uses.
Replace all uses of the constant with Undef in debug info metadata.
Definition at line 331 of file Metadata.cpp.
References llvm::CallingConv::C, llvm::cast(), llvm::dyn_cast_if_present(), llvm::PoisonValue::get(), llvm::ValueAsMetadata::get(), I, llvm::isa(), and Uses.
Referenced by constantIsDead(), and deleteIfDead().
|
friend |
Definition at line 390 of file Metadata.h.
References MetadataTracking.
Referenced by MetadataTracking.