LLVM 20.0.0git
|
Functions in this group model LLVMValueRef instances that correspond to constants referring to scalar types. More...
Functions | |
LLVMValueRef | LLVMConstInt (LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend) |
Obtain a constant value for an integer type. | |
LLVMValueRef | LLVMConstIntOfArbitraryPrecision (LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[]) |
Obtain a constant value for an integer of arbitrary precision. | |
LLVMValueRef | LLVMConstIntOfString (LLVMTypeRef IntTy, const char *Text, uint8_t Radix) |
Obtain a constant value for an integer parsed from a string. | |
LLVMValueRef | LLVMConstIntOfStringAndSize (LLVMTypeRef IntTy, const char *Text, unsigned SLen, uint8_t Radix) |
Obtain a constant value for an integer parsed from a string with specified length. | |
LLVMValueRef | LLVMConstReal (LLVMTypeRef RealTy, double N) |
Obtain a constant value referring to a double floating point value. | |
LLVMValueRef | LLVMConstRealOfString (LLVMTypeRef RealTy, const char *Text) |
Obtain a constant for a floating point value parsed from a string. | |
LLVMValueRef | LLVMConstRealOfStringAndSize (LLVMTypeRef RealTy, const char *Text, unsigned SLen) |
Obtain a constant for a floating point value parsed from a string. | |
unsigned long long | LLVMConstIntGetZExtValue (LLVMValueRef ConstantVal) |
Obtain the zero extended value for an integer constant value. | |
long long | LLVMConstIntGetSExtValue (LLVMValueRef ConstantVal) |
Obtain the sign extended value for an integer constant value. | |
double | LLVMConstRealGetDouble (LLVMValueRef ConstantVal, LLVMBool *losesInfo) |
Obtain the double value for an floating point constant value. | |
Functions in this group model LLVMValueRef instances that correspond to constants referring to scalar types.
For integer types, the LLVMTypeRef parameter should correspond to a llvm::IntegerType instance and the returned LLVMValueRef will correspond to a llvm::ConstantInt.
For floating point types, the LLVMTypeRef returned corresponds to a llvm::ConstantFP.
LLVMValueRef LLVMConstInt | ( | LLVMTypeRef | IntTy, |
unsigned long long | N, | ||
LLVMBool | SignExtend | ||
) |
Obtain a constant value for an integer type.
The returned value corresponds to a llvm::ConstantInt.
IntTy | Integer type to obtain value of. |
N | The value the returned instance should refer to. |
SignExtend | Whether to sign extend the produced value. |
Definition at line 1527 of file Core.cpp.
References N, and llvm::wrap().
long long LLVMConstIntGetSExtValue | ( | LLVMValueRef | ConstantVal | ) |
Obtain the sign extended value for an integer constant value.
unsigned long long LLVMConstIntGetZExtValue | ( | LLVMValueRef | ConstantVal | ) |
Obtain the zero extended value for an integer constant value.
LLVMValueRef LLVMConstIntOfArbitraryPrecision | ( | LLVMTypeRef | IntTy, |
unsigned | NumWords, | ||
const uint64_t | Words[] | ||
) |
Obtain a constant value for an integer of arbitrary precision.
Definition at line 1532 of file Core.cpp.
References llvm::IntegerType::getBitWidth(), llvm::Type::getContext(), and llvm::wrap().
LLVMValueRef LLVMConstIntOfString | ( | LLVMTypeRef | IntTy, |
const char * | Text, | ||
uint8_t | Radix | ||
) |
Obtain a constant value for an integer parsed from a string.
A similar API, LLVMConstIntOfStringAndSize is also available. If the string's length is available, it is preferred to call that function instead.
LLVMValueRef LLVMConstIntOfStringAndSize | ( | LLVMTypeRef | IntTy, |
const char * | Text, | ||
unsigned | SLen, | ||
uint8_t | Radix | ||
) |
Obtain a constant value for an integer parsed from a string with specified length.
LLVMValueRef LLVMConstReal | ( | LLVMTypeRef | RealTy, |
double | N | ||
) |
Obtain a constant value referring to a double floating point value.
Definition at line 1552 of file Core.cpp.
References N, unwrap(), and llvm::wrap().
double LLVMConstRealGetDouble | ( | LLVMValueRef | ConstantVal, |
LLVMBool * | losesInfo | ||
) |
Obtain the double value for an floating point constant value.
losesInfo indicates if some precision was lost in the conversion.
Definition at line 1573 of file Core.cpp.
References llvm::APFloat::convert(), llvm::APFloat::convertToDouble(), llvm::Value::getType(), llvm::ConstantFP::getValueAPF(), llvm::Type::isBFloatTy(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), and llvm::Type::isHalfTy().
LLVMValueRef LLVMConstRealOfString | ( | LLVMTypeRef | RealTy, |
const char * | Text | ||
) |
Obtain a constant for a floating point value parsed from a string.
A similar API, LLVMConstRealOfStringAndSize is also available. It should be used if the input string's length is known.
Definition at line 1556 of file Core.cpp.
References unwrap(), and llvm::wrap().
LLVMValueRef LLVMConstRealOfStringAndSize | ( | LLVMTypeRef | RealTy, |
const char * | Text, | ||
unsigned | SLen | ||
) |
Obtain a constant for a floating point value parsed from a string.