LLVM  17.0.0git
Functions
Composite Constants

Functions in this group operate on composite constants. More...

Collaboration diagram for Composite Constants:

Functions

LLVMValueRef LLVMConstStringInContext (LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
 Create a ConstantDataSequential and initialize it with a string. More...
 
LLVMValueRef LLVMConstString (const char *Str, unsigned Length, LLVMBool DontNullTerminate)
 Create a ConstantDataSequential with string content in the global context. More...
 
LLVMBool LLVMIsConstantString (LLVMValueRef c)
 Returns true if the specified constant is an array of i8. More...
 
const char * LLVMGetAsString (LLVMValueRef c, size_t *Length)
 Get the given constant data sequential as a string. More...
 
LLVMValueRef LLVMConstStructInContext (LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
 Create an anonymous ConstantStruct with the specified values. More...
 
LLVMValueRef LLVMConstStruct (LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
 Create a ConstantStruct in the global Context. More...
 
LLVMValueRef LLVMConstArray (LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
 Create a ConstantArray from values. More...
 
LLVMValueRef LLVMConstNamedStruct (LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
 Create a non-anonymous ConstantStruct from values. More...
 
LLVMValueRef LLVMGetAggregateElement (LLVMValueRef C, unsigned Idx)
 Get element of a constant aggregate (struct, array or vector) at the specified index. More...
 
 LLVM_ATTRIBUTE_C_DEPRECATED (LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx), "Use LLVMGetAggregateElement instead")
 Get an element at specified index as a constant. More...
 
LLVMValueRef LLVMConstVector (LLVMValueRef *ScalarConstantVals, unsigned Size)
 Create a ConstantVector from values. More...
 

Detailed Description

Functions in this group operate on composite constants.

Function Documentation

◆ LLVM_ATTRIBUTE_C_DEPRECATED()

LLVM_ATTRIBUTE_C_DEPRECATED ( LLVMValueRef   LLVMGetElementAsConstantLLVMValueRef C, unsigned idx,
"Use LLVMGetAggregateElement instead"   
)

Get an element at specified index as a constant.

See also
ConstantDataSequential::getElementAsConstant()

◆ LLVMConstArray()

LLVMValueRef LLVMConstArray ( LLVMTypeRef  ElementTy,
LLVMValueRef ConstantVals,
unsigned  Length 
)

Create a ConstantArray from values.

See also
llvm::ConstantArray::get()

Definition at line 1476 of file Core.cpp.

References llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::Length, llvm::unwrap(), and llvm::wrap().

◆ LLVMConstNamedStruct()

LLVMValueRef LLVMConstNamedStruct ( LLVMTypeRef  StructTy,
LLVMValueRef ConstantVals,
unsigned  Count 
)

Create a non-anonymous ConstantStruct from values.

See also
llvm::ConstantStruct::get()

Definition at line 1496 of file Core.cpp.

References llvm::ArrayRef(), llvm::ConstantStruct::get(), and llvm::wrap().

◆ LLVMConstString()

LLVMValueRef LLVMConstString ( const char *  Str,
unsigned  Length,
LLVMBool  DontNullTerminate 
)

Create a ConstantDataSequential with string content in the global context.

This is the same as LLVMConstStringInContext except it operates on the global context.

See also
LLVMConstStringInContext()
llvm::ConstantDataArray::getString()

Definition at line 1452 of file Core.cpp.

References llvm::Length, LLVMConstStringInContext(), and LLVMGetGlobalContext().

◆ LLVMConstStringInContext()

LLVMValueRef LLVMConstStringInContext ( LLVMContextRef  C,
const char *  Str,
unsigned  Length,
LLVMBool  DontNullTerminate 
)

Create a ConstantDataSequential and initialize it with a string.

See also
llvm::ConstantDataArray::getString()

Definition at line 1443 of file Core.cpp.

References llvm::ConstantDataArray::getString(), llvm::Length, llvm::unwrap(), and llvm::wrap().

Referenced by LLVMConstString().

◆ LLVMConstStruct()

LLVMValueRef LLVMConstStruct ( LLVMValueRef ConstantVals,
unsigned  Count,
LLVMBool  Packed 
)

Create a ConstantStruct in the global Context.

This is the same as LLVMConstStructInContext except it operates on the global Context.

See also
LLVMConstStructInContext()

Definition at line 1490 of file Core.cpp.

References LLVMConstStructInContext(), and LLVMGetGlobalContext().

◆ LLVMConstStructInContext()

LLVMValueRef LLVMConstStructInContext ( LLVMContextRef  C,
LLVMValueRef ConstantVals,
unsigned  Count,
LLVMBool  Packed 
)

Create an anonymous ConstantStruct with the specified values.

See also
llvm::ConstantStruct::getAnon()

Definition at line 1482 of file Core.cpp.

References llvm::ArrayRef(), llvm::ConstantStruct::getAnon(), llvm::unwrap(), and llvm::wrap().

Referenced by LLVMConstStruct().

◆ LLVMConstVector()

LLVMValueRef LLVMConstVector ( LLVMValueRef ScalarConstantVals,
unsigned  Size 
)

Create a ConstantVector from values.

See also
llvm::ConstantVector::get()

Definition at line 1505 of file Core.cpp.

References llvm::ArrayRef(), llvm::ConstantVector::get(), and llvm::wrap().

◆ LLVMGetAggregateElement()

LLVMValueRef LLVMGetAggregateElement ( LLVMValueRef  C,
unsigned  Idx 
)

Get element of a constant aggregate (struct, array or vector) at the specified index.

Returns null if the index is out of range, or it's not possible to determine the element (e.g., because the constant is a constant expression.)

See also
llvm::Constant::getAggregateElement()

Definition at line 1458 of file Core.cpp.

References llvm::wrap().

◆ LLVMGetAsString()

const char* LLVMGetAsString ( LLVMValueRef  c,
size_t *  Length 
)

Get the given constant data sequential as a string.

See also
ConstantDataSequential::getAsString()

Definition at line 1470 of file Core.cpp.

References llvm::Length.

◆ LLVMIsConstantString()

LLVMBool LLVMIsConstantString ( LLVMValueRef  c)

Returns true if the specified constant is an array of i8.

See also
ConstantDataSequential::getAsString()

Definition at line 1466 of file Core.cpp.