LLVM 20.0.0git
Macros | Functions

Functions in this section work on all LLVMValueRef instances, regardless of their sub-type. More...

Collaboration diagram for General APIs:

Macros

#define LLVM_DECLARE_VALUE_CAST(name)    LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
 Convert value instances between types.
 

Functions

LLVMTypeRef LLVMTypeOf (LLVMValueRef Val)
 Obtain the type of a value.
 
LLVMValueKind LLVMGetValueKind (LLVMValueRef Val)
 Obtain the enumerated type of a Value instance.
 
const charLLVMGetValueName2 (LLVMValueRef Val, size_t *Length)
 Obtain the string name of a value.
 
void LLVMSetValueName2 (LLVMValueRef Val, const char *Name, size_t NameLen)
 Set the string name of a value.
 
void LLVMDumpValue (LLVMValueRef Val)
 Dump a representation of a value to stderr.
 
charLLVMPrintValueToString (LLVMValueRef Val)
 Return a string representation of the value.
 
LLVMContextRef LLVMGetValueContext (LLVMValueRef Val)
 Obtain the context to which this value is associated.
 
charLLVMPrintDbgRecordToString (LLVMDbgRecordRef Record)
 Return a string representation of the DbgRecord.
 
void LLVMReplaceAllUsesWith (LLVMValueRef OldVal, LLVMValueRef NewVal)
 Replace all uses of a value with another one.
 
LLVMBool LLVMIsConstant (LLVMValueRef Val)
 Determine whether the specified value instance is constant.
 
LLVMBool LLVMIsUndef (LLVMValueRef Val)
 Determine whether a value instance is undefined.
 
LLVMBool LLVMIsPoison (LLVMValueRef Val)
 Determine whether a value instance is poisonous.
 
LLVMValueRef LLVMIsAMDNode (LLVMValueRef Val)
 
LLVMValueRef LLVMIsAValueAsMetadata (LLVMValueRef Val)
 
LLVMValueRef LLVMIsAMDString (LLVMValueRef Val)
 
const charLLVMGetValueName (LLVMValueRef Val)
 Deprecated: Use LLVMGetValueName2 instead.
 
void LLVMSetValueName (LLVMValueRef Val, const char *Name)
 Deprecated: Use LLVMSetValueName2 instead.
 

Detailed Description

Functions in this section work on all LLVMValueRef instances, regardless of their sub-type.

They correspond to functions available on llvm::Value.

Macro Definition Documentation

◆ LLVM_DECLARE_VALUE_CAST

#define LLVM_DECLARE_VALUE_CAST (   name)     LLVMValueRef LLVMIsA##name(LLVMValueRef Val);

Convert value instances between types.

Internally, an LLVMValueRef is "pinned" to a specific type. This series of functions allows you to cast an instance to a specific type.

If the cast is not valid for the specified type, NULL is returned.

See also
llvm::dyn_cast_or_null<>

Definition at line 2029 of file Core.h.

Function Documentation

◆ LLVMDumpValue()

void LLVMDumpValue ( LLVMValueRef  Val)

Dump a representation of a value to stderr.

See also
llvm::Value::dump()

Definition at line 1034 of file Core.cpp.

References llvm::errs(), llvm::BasicBlock::print(), and unwrap().

◆ LLVMGetValueContext()

LLVMContextRef LLVMGetValueContext ( LLVMValueRef  Val)

Obtain the context to which this value is associated.

See also
llvm::Value::getContext()

Definition at line 1052 of file Core.cpp.

References unwrap(), and llvm::wrap().

◆ LLVMGetValueKind()

LLVMValueKind LLVMGetValueKind ( LLVMValueRef  Val)

Obtain the enumerated type of a Value instance.

See also
llvm::Value::getValueID()

Definition at line 1004 of file Core.cpp.

References LLVMInstructionValueKind, and unwrap().

◆ LLVMGetValueName()

const char * LLVMGetValueName ( LLVMValueRef  Val)

Deprecated: Use LLVMGetValueName2 instead.

Definition at line 1026 of file Core.cpp.

References llvm::StringRef::data(), llvm::Value::getName(), and unwrap().

◆ LLVMGetValueName2()

const char * LLVMGetValueName2 ( LLVMValueRef  Val,
size_t *  Length 
)

Obtain the string name of a value.

See also
llvm::Value::getName()

Definition at line 1016 of file Core.cpp.

References llvm::Length, and unwrap().

◆ LLVMIsAMDNode()

LLVMValueRef LLVMIsAMDNode ( LLVMValueRef  Val)

Definition at line 1148 of file Core.cpp.

References unwrap().

◆ LLVMIsAMDString()

LLVMValueRef LLVMIsAMDString ( LLVMValueRef  Val)

Definition at line 1163 of file Core.cpp.

References unwrap().

◆ LLVMIsAValueAsMetadata()

LLVMValueRef LLVMIsAValueAsMetadata ( LLVMValueRef  Val)

Definition at line 1156 of file Core.cpp.

References unwrap().

◆ LLVMIsConstant()

LLVMBool LLVMIsConstant ( LLVMValueRef  Val)

Determine whether the specified value instance is constant.

Definition at line 1255 of file Core.cpp.

References unwrap().

◆ LLVMIsPoison()

LLVMBool LLVMIsPoison ( LLVMValueRef  Val)

Determine whether a value instance is poisonous.

Definition at line 1269 of file Core.cpp.

References unwrap().

◆ LLVMIsUndef()

LLVMBool LLVMIsUndef ( LLVMValueRef  Val)

Determine whether a value instance is undefined.

Definition at line 1265 of file Core.cpp.

References unwrap().

◆ LLVMPrintDbgRecordToString()

char * LLVMPrintDbgRecordToString ( LLVMDbgRecordRef  Record)

Return a string representation of the DbgRecord.

Use LLVMDisposeMessage to free the string.

See also
llvm::DbgRecord::print()

Definition at line 1056 of file Core.cpp.

References llvm::raw_ostream::flush(), llvm::BasicBlock::print(), and unwrap().

◆ LLVMPrintValueToString()

char * LLVMPrintValueToString ( LLVMValueRef  Val)

Return a string representation of the value.

Use LLVMDisposeMessage to free the string.

See also
llvm::Value::print()

Definition at line 1038 of file Core.cpp.

References llvm::raw_ostream::flush(), llvm::BasicBlock::print(), and unwrap().

◆ LLVMReplaceAllUsesWith()

void LLVMReplaceAllUsesWith ( LLVMValueRef  OldVal,
LLVMValueRef  NewVal 
)

Replace all uses of a value with another one.

See also
llvm::Value::replaceAllUsesWith()

Definition at line 1070 of file Core.cpp.

References llvm::Value::replaceAllUsesWith(), and unwrap().

◆ LLVMSetValueName()

void LLVMSetValueName ( LLVMValueRef  Val,
const char Name 
)

Deprecated: Use LLVMSetValueName2 instead.

Definition at line 1030 of file Core.cpp.

References Name, llvm::Value::setName(), and unwrap().

◆ LLVMSetValueName2()

void LLVMSetValueName2 ( LLVMValueRef  Val,
const char Name,
size_t  NameLen 
)

Set the string name of a value.

See also
llvm::Value::setName()

Definition at line 1022 of file Core.cpp.

References Name, llvm::Value::setName(), and unwrap().

◆ LLVMTypeOf()

LLVMTypeRef LLVMTypeOf ( LLVMValueRef  Val)

Obtain the type of a value.

See also
llvm::Value::getType()

Definition at line 1000 of file Core.cpp.

References getType(), unwrap(), and llvm::wrap().