LLVM 18.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::ValueAsMetadata Class Reference

Value wrapper in the Metadata hierarchy. More...

#include "llvm/IR/Metadata.h"

Inheritance diagram for llvm::ValueAsMetadata:
Inheritance graph

Public Member Functions

ValuegetValue () const
TypegetType () const
LLVMContextgetContext () const
SmallVector< Metadata * > getAllArgListUsers ()

Static Public Member Functions

static ValueAsMetadataget (Value *V)
static ConstantAsMetadatagetConstant (Value *C)
static LocalAsMetadatagetLocal (Value *Local)
static ValueAsMetadatagetIfExists (Value *V)
static ConstantAsMetadatagetConstantIfExists (Value *C)
static LocalAsMetadatagetLocalIfExists (Value *Local)
static void handleDeletion (Value *V)
static void handleRAUW (Value *From, Value *To)
static bool classof (const Metadata *MD)

Protected Member Functions

 ValueAsMetadata (unsigned ID, Value *V)
 ~ValueAsMetadata ()=default
void replaceAllUsesWith (Metadata *MD)
 Handle collisions after Value::replaceAllUsesWith().


class ReplaceableMetadataImpl
class LLVMContextImpl

Additional Inherited Members

 Active type of storage. More...

Detailed Description

Value wrapper in the Metadata hierarchy.

This is a custom value handle that allows other metadata to refer to classes in the Value hierarchy.

Because of full uniquing support, each value is only wrapped by a single ValueAsMetadata object, so the lookup maps are far more efficient than those using ValueHandleBase.

Definition at line 344 of file Metadata.h.

Constructor & Destructor Documentation

◆ ValueAsMetadata()

llvm::ValueAsMetadata::ValueAsMetadata ( unsigned  ID,
Value V 

Definition at line 356 of file Metadata.h.

References assert().

◆ ~ValueAsMetadata()

llvm::ValueAsMetadata::~ValueAsMetadata ( )

Member Function Documentation

◆ classof()

static bool llvm::ValueAsMetadata::classof ( const Metadata MD)

Definition at line 406 of file Metadata.h.

References llvm::Metadata::getMetadataID().

◆ get()

ValueAsMetadata * ValueAsMetadata::get ( Value V)

◆ getAllArgListUsers()

SmallVector< Metadata * > llvm::ValueAsMetadata::getAllArgListUsers ( )

Definition at line 388 of file Metadata.h.

References llvm::ReplaceableMetadataImpl::getAllArgListUsers().

◆ getConstant()

static ConstantAsMetadata * llvm::ValueAsMetadata::getConstant ( Value C)

Definition at line 366 of file Metadata.h.

References llvm::CallingConv::C, and get().

Referenced by llvm::ConstantAsMetadata::get(), and wrapConstantAsMetadata().

◆ getConstantIfExists()

static ConstantAsMetadata * llvm::ValueAsMetadata::getConstantIfExists ( Value C)

Definition at line 376 of file Metadata.h.

References llvm::CallingConv::C, and getIfExists().

Referenced by llvm::ConstantAsMetadata::getIfExists().

◆ getContext()

LLVMContext & llvm::ValueAsMetadata::getContext ( ) const

Definition at line 386 of file Metadata.h.

◆ getIfExists()

ValueAsMetadata * ValueAsMetadata::getIfExists ( Value V)

Definition at line 413 of file Metadata.cpp.

References assert().

Referenced by getConstantIfExists(), and getLocalIfExists().

◆ getLocal()

static LocalAsMetadata * llvm::ValueAsMetadata::getLocal ( Value Local)

Definition at line 370 of file Metadata.h.

References get().

Referenced by llvm::LocalAsMetadata::get().

◆ getLocalIfExists()

static LocalAsMetadata * llvm::ValueAsMetadata::getLocalIfExists ( Value Local)

Definition at line 380 of file Metadata.h.

References getIfExists().

Referenced by llvm::LocalAsMetadata::getIfExists().

◆ getType()

Type * llvm::ValueAsMetadata::getType ( ) const

Definition at line 385 of file Metadata.h.

◆ getValue()

Value * llvm::ValueAsMetadata::getValue ( ) const

◆ handleDeletion()

void ValueAsMetadata::handleDeletion ( Value V)

Definition at line 418 of file Metadata.cpp.

References assert(), getValue(), I, and replaceAllUsesWith().

Referenced by llvm::Value::~Value().

◆ handleRAUW()

void ValueAsMetadata::handleRAUW ( Value From,
Value To 

◆ replaceAllUsesWith()

void llvm::ValueAsMetadata::replaceAllUsesWith ( Metadata MD)

Handle collisions after Value::replaceAllUsesWith().

RAUW isn't supported directly for ValueAsMetadata, but if the wrapped Value gets RAUW'ed and the target already exists, this is used to merge the two metadata nodes.

Definition at line 401 of file Metadata.h.

References llvm::ReplaceableMetadataImpl::replaceAllUsesWith().

Referenced by handleDeletion(), and handleRAUW().

Friends And Related Function Documentation

◆ LLVMContextImpl

friend class LLVMContextImpl

Definition at line 346 of file Metadata.h.

◆ ReplaceableMetadataImpl

friend class ReplaceableMetadataImpl

Definition at line 345 of file Metadata.h.

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