LLVM  5.0.0
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:
[legend]
Collaboration diagram for llvm::ValueAsMetadata:
[legend]

Public Member Functions

Value * getValue () const
 
Type * getType () const
 
LLVMContext & getContext () const
 

Static Public Member Functions

static ValueAsMetadata * get (Value *V)
 
static ConstantAsMetadata * getConstant (Value *C)
 
static LocalAsMetadata * getLocal (Value *Local)
 
static ValueAsMetadata * getIfExists (Value *V)
 
static ConstantAsMetadata * getConstantIfExists (Value *C)
 
static LocalAsMetadata * getLocalIfExists (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(). More...
 

Friends

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

Constructor & Destructor Documentation

llvm::ValueAsMetadata::ValueAsMetadata ( unsigned  ID,
Value *  V 
)
inlineprotected

Definition at line 349 of file Metadata.h.

References assert().

llvm::ValueAsMetadata::~ValueAsMetadata ( )
protecteddefault

Member Function Documentation

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

Definition at line 395 of file Metadata.h.

References llvm::Metadata::getMetadataID().

ValueAsMetadata * ValueAsMetadata::get ( Value *  V)
static
static ConstantAsMetadata* llvm::ValueAsMetadata::getConstant ( Value *  C)
inlinestatic

Definition at line 359 of file Metadata.h.

References C.

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

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

Definition at line 369 of file Metadata.h.

References getIfExists().

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

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

Definition at line 379 of file Metadata.h.

References llvm::Value::getContext().

ValueAsMetadata * ValueAsMetadata::getIfExists ( Value *  V)
static
static LocalAsMetadata* llvm::ValueAsMetadata::getLocal ( Value *  Local)
inlinestatic

Definition at line 363 of file Metadata.h.

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

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

Definition at line 373 of file Metadata.h.

References getIfExists().

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

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

Definition at line 378 of file Metadata.h.

References llvm::Value::getType().

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

Definition at line 377 of file Metadata.h.

Referenced by llvm::ConstantAsMetadata::getValue(), handleDeletion(), and handleRAUW().

void ValueAsMetadata::handleDeletion ( Value *  V)
static
void ValueAsMetadata::handleRAUW ( Value *  From,
Value *  To 
)
static
void llvm::ValueAsMetadata::replaceAllUsesWith ( Metadata *  MD)
inlineprotected

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

References llvm::ReplaceableMetadataImpl::replaceAllUsesWith().

Referenced by handleDeletion(), and handleRAUW().

Friends And Related Function Documentation

friend class LLVMContextImpl
friend

Definition at line 339 of file Metadata.h.

friend class ReplaceableMetadataImpl
friend

Definition at line 338 of file Metadata.h.


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