LLVM 22.0.0git

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)
 Convert value instances between types.

Functions

LLVM_C_ABI LLVMTypeRef LLVMTypeOf (LLVMValueRef Val)
 Obtain the type of a value.
LLVM_C_ABI LLVMValueKind LLVMGetValueKind (LLVMValueRef Val)
 Obtain the enumerated type of a Value instance.
LLVM_C_ABI const charLLVMGetValueName2 (LLVMValueRef Val, size_t *Length)
 Obtain the string name of a value.
LLVM_C_ABI void LLVMSetValueName2 (LLVMValueRef Val, const char *Name, size_t NameLen)
 Set the string name of a value.
LLVM_C_ABI void LLVMDumpValue (LLVMValueRef Val)
 Dump a representation of a value to stderr.
LLVM_C_ABI charLLVMPrintValueToString (LLVMValueRef Val)
 Return a string representation of the value.
LLVM_C_ABI LLVMContextRef LLVMGetValueContext (LLVMValueRef Val)
 Obtain the context to which this value is associated.
LLVM_C_ABI charLLVMPrintDbgRecordToString (LLVMDbgRecordRef Record)
 Return a string representation of the DbgRecord.
LLVM_C_ABI void LLVMReplaceAllUsesWith (LLVMValueRef OldVal, LLVMValueRef NewVal)
 Replace all uses of a value with another one.
LLVM_C_ABI LLVMBool LLVMIsConstant (LLVMValueRef Val)
 Determine whether the specified value instance is constant.
LLVM_C_ABI LLVMBool LLVMIsUndef (LLVMValueRef Val)
 Determine whether a value instance is undefined.
LLVM_C_ABI LLVMBool LLVMIsPoison (LLVMValueRef Val)
 Determine whether a value instance is poisonous.
LLVM_C_ABI LLVMValueRef LLVMIsAMDNode (LLVMValueRef Val)
LLVM_C_ABI LLVMValueRef LLVMIsAValueAsMetadata (LLVMValueRef Val)
LLVM_C_ABI LLVMValueRef LLVMIsAMDString (LLVMValueRef Val)
LLVM_C_ABI const charLLVMGetValueName (LLVMValueRef Val)
 Deprecated: Use LLVMGetValueName2 instead.
LLVM_C_ABI 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)
Value:
static const char * name
#define LLVM_C_ABI
LLVM_C_ABI is the export/visibility macro used to mark symbols declared in llvm-c as exported when bu...
Definition Visibility.h:40
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition Types.h:75

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 2075 of file Core.h.

Function Documentation

◆ LLVMDumpValue()

LLVM_C_ABI void LLVMDumpValue ( LLVMValueRef Val)

Dump a representation of a value to stderr.

See also
llvm::Value::dump()

Definition at line 1036 of file Core.cpp.

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

◆ LLVMGetValueContext()

LLVM_C_ABI LLVMContextRef LLVMGetValueContext ( LLVMValueRef Val)

Obtain the context to which this value is associated.

See also
llvm::Value::getContext()

Definition at line 1054 of file Core.cpp.

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

◆ LLVMGetValueKind()

LLVM_C_ABI LLVMValueKind LLVMGetValueKind ( LLVMValueRef Val)

Obtain the enumerated type of a Value instance.

See also
llvm::Value::getValueID()

Definition at line 1006 of file Core.cpp.

References LLVMInstructionValueKind, and llvm::unwrap().

◆ LLVMGetValueName()

LLVM_C_ABI const char * LLVMGetValueName ( LLVMValueRef Val)

Deprecated: Use LLVMGetValueName2 instead.

Definition at line 1028 of file Core.cpp.

References llvm::unwrap().

◆ LLVMGetValueName2()

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

Obtain the string name of a value.

See also
llvm::Value::getName()

Definition at line 1018 of file Core.cpp.

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

◆ LLVMIsAMDNode()

LLVM_C_ABI LLVMValueRef LLVMIsAMDNode ( LLVMValueRef Val)

Definition at line 1150 of file Core.cpp.

References llvm::dyn_cast_or_null(), llvm::isa(), LLVMIsAMDNode(), and llvm::unwrap().

Referenced by LLVMIsAMDNode().

◆ LLVMIsAMDString()

LLVM_C_ABI LLVMValueRef LLVMIsAMDString ( LLVMValueRef Val)

Definition at line 1165 of file Core.cpp.

References llvm::dyn_cast_or_null(), llvm::isa(), and llvm::unwrap().

◆ LLVMIsAValueAsMetadata()

LLVM_C_ABI LLVMValueRef LLVMIsAValueAsMetadata ( LLVMValueRef Val)

Definition at line 1158 of file Core.cpp.

References llvm::dyn_cast_or_null(), llvm::isa(), and llvm::unwrap().

◆ LLVMIsConstant()

LLVM_C_ABI LLVMBool LLVMIsConstant ( LLVMValueRef Val)

Determine whether the specified value instance is constant.

Definition at line 1257 of file Core.cpp.

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

◆ LLVMIsPoison()

LLVM_C_ABI LLVMBool LLVMIsPoison ( LLVMValueRef Val)

Determine whether a value instance is poisonous.

Definition at line 1271 of file Core.cpp.

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

◆ LLVMIsUndef()

LLVM_C_ABI LLVMBool LLVMIsUndef ( LLVMValueRef Val)

Determine whether a value instance is undefined.

Definition at line 1267 of file Core.cpp.

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

◆ LLVMPrintDbgRecordToString()

LLVM_C_ABI 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 1058 of file Core.cpp.

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

◆ LLVMPrintValueToString()

LLVM_C_ABI 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 1040 of file Core.cpp.

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

◆ LLVMReplaceAllUsesWith()

LLVM_C_ABI void LLVMReplaceAllUsesWith ( LLVMValueRef OldVal,
LLVMValueRef NewVal )

Replace all uses of a value with another one.

See also
llvm::Value::replaceAllUsesWith()

Definition at line 1072 of file Core.cpp.

References llvm::unwrap().

◆ LLVMSetValueName()

LLVM_C_ABI void LLVMSetValueName ( LLVMValueRef Val,
const char * Name )

Deprecated: Use LLVMSetValueName2 instead.

Definition at line 1032 of file Core.cpp.

References llvm::unwrap().

◆ LLVMSetValueName2()

LLVM_C_ABI 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 1024 of file Core.cpp.

References llvm::unwrap().

◆ LLVMTypeOf()

LLVM_C_ABI LLVMTypeRef LLVMTypeOf ( LLVMValueRef Val)

Obtain the type of a value.

See also
llvm::Value::getType()

Definition at line 1002 of file Core.cpp.

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