LLVM  6.0.0svn
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. More...
 

Functions

LLVMTypeRef LLVMTypeOf (LLVMValueRef Val)
 Obtain the type of a value. More...
 
LLVMValueKind LLVMGetValueKind (LLVMValueRef Val)
 Obtain the enumerated type of a Value instance. More...
 
const charLLVMGetValueName (LLVMValueRef Val)
 Obtain the string name of a value. More...
 
void LLVMSetValueName (LLVMValueRef Val, const char *Name)
 Set the string name of a value. More...
 
void LLVMDumpValue (LLVMValueRef Val)
 Dump a representation of a value to stderr. More...
 
charLLVMPrintValueToString (LLVMValueRef Val)
 Return a string representation of the value. More...
 
void LLVMReplaceAllUsesWith (LLVMValueRef OldVal, LLVMValueRef NewVal)
 Replace all uses of a value with another one. More...
 
LLVMBool LLVMIsConstant (LLVMValueRef Val)
 Determine whether the specified value instance is constant. More...
 
LLVMBool LLVMIsUndef (LLVMValueRef Val)
 Determine whether a value instance is undefined. More...
 
LLVMValueRef LLVMIsAMDNode (LLVMValueRef Val)
 
LLVMValueRef LLVMIsAMDString (LLVMValueRef Val)
 

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 1337 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 657 of file Core.cpp.

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

◆ LLVMGetValueKind()

LLVMValueKind LLVMGetValueKind ( LLVMValueRef  Val)

Obtain the enumerated type of a Value instance.

See also
llvm::Value::getValueID()

Definition at line 638 of file Core.cpp.

References LLVMInstructionValueKind, and llvm::unwrap().

◆ LLVMGetValueName()

const char* LLVMGetValueName ( LLVMValueRef  Val)

Obtain the string name of a value.

See also
llvm::Value::getName()

Definition at line 649 of file Core.cpp.

References llvm::unwrap().

◆ LLVMIsAMDNode()

LLVMValueRef LLVMIsAMDNode ( LLVMValueRef  Val)

Definition at line 720 of file Core.cpp.

References llvm::unwrap().

◆ LLVMIsAMDString()

LLVMValueRef LLVMIsAMDString ( LLVMValueRef  Val)

Definition at line 728 of file Core.cpp.

References llvm::unwrap().

◆ LLVMIsConstant()

LLVMBool LLVMIsConstant ( LLVMValueRef  Val)

Determine whether the specified value instance is constant.

Definition at line 816 of file Core.cpp.

References llvm::unwrap().

◆ LLVMIsUndef()

LLVMBool LLVMIsUndef ( LLVMValueRef  Val)

Determine whether a value instance is undefined.

Definition at line 826 of file Core.cpp.

References llvm::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 661 of file Core.cpp.

References llvm::raw_ostream::flush(), and llvm::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 675 of file Core.cpp.

References llvm::unwrap().

◆ LLVMSetValueName()

void LLVMSetValueName ( LLVMValueRef  Val,
const char Name 
)

Set the string name of a value.

See also
llvm::Value::setName()

Definition at line 653 of file Core.cpp.

References llvm::unwrap().

◆ LLVMTypeOf()

LLVMTypeRef LLVMTypeOf ( LLVMValueRef  Val)

Obtain the type of a value.

See also
llvm::Value::getType()

Definition at line 634 of file Core.cpp.

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