A converter from LLVM constant to constant in BIR.
More...
#include <llvm_constant_converter.h>
A converter from LLVM constant to constant in BIR.
This converter handles only constant values, not constant expressions.
- Preconditions
-
◆ LLVMConstantConverter()
Constructs a new converter.
◆ convertToExpression() [1/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
const llvm::ConstantFP * |
cFloat | ) |
|
|
private |
Converts the given LLVM floating point constant cFloat into an expression in BIR.
- Preconditions
-
◆ convertToExpression() [2/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
const llvm::ConstantInt * |
cInt | ) |
|
|
private |
Converts the given LLVM boolean or integer constant cInt into an expression in BIR.
- Preconditions
-
◆ convertToExpression() [3/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
const llvm::ConstantPointerNull * |
cNullPtr | ) |
|
|
private |
Converts the given LLVM null pointer constant cNullPtr into an expression in BIR.
- Preconditions
-
◆ convertToExpression() [4/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
const llvm::ConstantStruct * |
cStruct | ) |
|
|
private |
Converts the given LLVM constant struct cStruct into an expression in BIR.
- Preconditions
-
◆ convertToExpression() [5/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
llvm::Constant * |
constant | ) |
|
Converts the given LLVM constant constant into an expression in BIR.
- Preconditions
-
◆ convertToExpression() [6/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
llvm::ConstantArray * |
cArray | ) |
|
|
private |
Converts the given LLVM constant array cArray into an expression in BIR.
Constant array consists of any type of constants, but for some specific constant arrays can be created LLVM types llvm::ConstantDataArray
or llvm::ConstantAggregateZero
. llvm::ConstantDataArray
is created for array of simple constants like integers or floats and llvm::ConstantAggregateZero
is created for zero initialized constant arrays.
- Preconditions
-
◆ convertToExpression() [7/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
llvm::ConstantDataArray * |
cArray | ) |
|
|
private |
Converts the given LLVM constant data array cArray into an expression in BIR.
Constant data array consists only of a simple elements, which means integer or floating point constants.
- Preconditions
-
◆ convertToExpression() [8/8]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertToExpression |
( |
llvm::GlobalVariable * |
globVar | ) |
|
|
private |
Converts the given LLVM global value globVar into an expression in BIR.
- Preconditions
-
◆ convertZeroInitializer() [1/5]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertZeroInitializer |
( |
const llvm::ArrayType * |
type | ) |
|
|
private |
Converts zero initialization of the given LLVM array type type into an expression in BIR.
Zero initialized array means that all values inside it are initialized to zeros.
- Preconditions
-
◆ convertZeroInitializer() [2/5]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertZeroInitializer |
( |
const llvm::IntegerType * |
type | ) |
|
|
private |
Converts zero initialization of the given LLVM integer type type into an expression in BIR.
- Preconditions
-
◆ convertZeroInitializer() [3/5]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertZeroInitializer |
( |
const llvm::PointerType * |
type | ) |
|
|
private |
Converts zero initialization of the given LLVM pointer type type into an expression in BIR. It created null pointer.
- Preconditions
-
◆ convertZeroInitializer() [4/5]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertZeroInitializer |
( |
const llvm::StructType * |
type | ) |
|
|
private |
Converts zero initialization of the given LLVM struct type type into an expression in BIR.
Zero initialized struct means that all values inside it are initialized to zeros.
- Preconditions
-
◆ convertZeroInitializer() [5/5]
ShPtr< Expression > retdec::llvmir2hll::LLVMConstantConverter::convertZeroInitializer |
( |
const llvm::Type * |
type | ) |
|
|
private |
Converts zero initialization of the given LLVM type type into an expression in BIR.
Zero initialization means that value is zero (for scalar types) or all values inside composite type are zeros.
- Preconditions
-
◆ getConverter()
◆ getNameOfStructElement()
ShPtr< ConstInt > retdec::llvmir2hll::LLVMConstantConverter::getNameOfStructElement |
( |
unsigned |
index | ) |
const |
|
private |
Creates name of structure element with given index index.
◆ isBool()
bool retdec::llvmir2hll::LLVMConstantConverter::isBool |
( |
const llvm::ConstantInt * |
cInt | ) |
const |
|
private |
Determines if given LLVM integral constant cInt is boolean.
- Preconditions
-
◆ setLLVMValueConverter()
Sets converter for LLVM values to the given conv.
- Preconditions
-
◆ converter
A converter from LLVM values to values in BIR.
◆ instConverter
A converter from LLVM instruction to expression in BIR.
◆ typeConverter
A converter from LLVM type to type in BIR.
The documentation for this class was generated from the following files: