retdec
|
Functions | |
llvm::Value * | skipCasts (llvm::Value *val) |
llvm::IntegerType * | getCharType (llvm::LLVMContext &ctx) |
llvm::PointerType * | getCharPointerType (llvm::LLVMContext &ctx) |
bool | isCharType (const llvm::Type *t) |
bool | isCharPointerType (const llvm::Type *t) |
bool | isStringArrayType (const llvm::Type *t) |
bool | isStringArrayPointeType (const llvm::Type *t) |
llvm::Type * | stringToLlvmType (llvm::LLVMContext &ctx, const std::string &str) |
llvm::Type * | stringToLlvmTypeDefault (llvm::Module *m, const std::string &str) |
std::vector< llvm::Type * > | parseFormatString (llvm::Module *module, const std::string &format, llvm::Function *calledFnc=nullptr) |
bool | parseTypeList (LLVMContext &ctx, std::string list, std::vector< Type * > &typeList) |
Type * | stringToLlvmType (LLVMContext &ctx, const std::string &str) |
llvm::PointerType * retdec::bin2llvmir::llvm_utils::getCharPointerType | ( | llvm::LLVMContext & | ctx | ) |
llvm::IntegerType * retdec::bin2llvmir::llvm_utils::getCharType | ( | llvm::LLVMContext & | ctx | ) |
bool retdec::bin2llvmir::llvm_utils::isCharPointerType | ( | const llvm::Type * | t | ) |
True
if t is the same as getCharPointerType()
result, false
otherwise. bool retdec::bin2llvmir::llvm_utils::isCharType | ( | const llvm::Type * | t | ) |
True
if t is the same as getCharType()
result, false
otherwise. bool retdec::bin2llvmir::llvm_utils::isStringArrayPointeType | ( | const llvm::Type * | t | ) |
True
if t is a pointer to string array type (see isStringArrayType
), false
otherwise. bool retdec::bin2llvmir::llvm_utils::isStringArrayType | ( | const llvm::Type * | t | ) |
True
if t is a string array – an array of char elements, false
otherwise. std::vector< llvm::Type * > retdec::bin2llvmir::llvm_utils::parseFormatString | ( | llvm::Module * | module, |
const std::string & | format, | ||
llvm::Function * | calledFnc | ||
) |
Parse format string format used in functions such as printf
or scanf
into vector of data types in context of module module. If calledFnc provided and called function name contains "scan" string, all types are transformed to pointers.
This is done according to: http://www.cplusplus.com/reference/cstdio/printf/ but we need small updates, because it is used for scanf where are small differences in floating point numbers: http://www.cplusplus.com/reference/cstdio/scanf/
bool retdec::bin2llvmir::llvm_utils::parseTypeList | ( | LLVMContext & | ctx, |
std::string | list, | ||
std::vector< Type * > & | typeList | ||
) |
Parse string with list of LLVM types (i.e. "t1,..,tn") into vector of LLVM types.
ctx | Context in which the LLVM type is created. | |
list | String list to parse. | |
[out] | typeList | Output vector to fill. |
False
if parsing was successful, true
otherwise. llvm::Value * retdec::bin2llvmir::llvm_utils::skipCasts | ( | llvm::Value * | val | ) |
Skips both casts and getelementptr instructions and constant expressions.
llvm::Type* retdec::bin2llvmir::llvm_utils::stringToLlvmType | ( | llvm::LLVMContext & | ctx, |
const std::string & | str | ||
) |
Type* retdec::bin2llvmir::llvm_utils::stringToLlvmType | ( | LLVMContext & | ctx, |
const std::string & | str | ||
) |
Convert the provided LLVM type string representation into an LLVM type.
ctx | Context in which the LLVM type is created. |
str | String with LLVM type representation. |
nullptr
otherwise. llvm::Type * retdec::bin2llvmir::llvm_utils::stringToLlvmTypeDefault | ( | llvm::Module * | m, |
const std::string & | str | ||
) |
This is the same as stringToLlvmType()
, but default type is returned instead of nulltpr.