retdec
llvm.h
Go to the documentation of this file.
1 
11 #ifndef RETDEC_BIN2LLVMIR_UTILS_LLVM_H
12 #define RETDEC_BIN2LLVMIR_UTILS_LLVM_H
13 
14 #include <llvm/IR/Constants.h>
15 #include <llvm/IR/Instruction.h>
16 #include <llvm/IR/Instructions.h>
17 #include <llvm/IR/Module.h>
18 #include <llvm/IR/Type.h>
19 #include <llvm/IR/Value.h>
20 
21 namespace retdec {
22 namespace bin2llvmir {
23 namespace llvm_utils {
24 
25 //
26 //==============================================================================
27 // Values
28 //==============================================================================
29 //
30 
31 llvm::Value* skipCasts(llvm::Value* val);
32 
33 //
34 //==============================================================================
35 // Types
36 //==============================================================================
37 //
38 
39 llvm::IntegerType* getCharType(llvm::LLVMContext& ctx);
40 llvm::PointerType* getCharPointerType(llvm::LLVMContext& ctx);
41 
42 bool isCharType(const llvm::Type* t);
43 bool isCharPointerType(const llvm::Type* t);
44 bool isStringArrayType(const llvm::Type* t);
45 bool isStringArrayPointeType(const llvm::Type* t);
46 
47 llvm::Type* stringToLlvmType(llvm::LLVMContext& ctx, const std::string& str);
48 llvm::Type* stringToLlvmTypeDefault(llvm::Module* m, const std::string& str);
49 
50 std::vector<llvm::Type*> parseFormatString(
51  llvm::Module* module,
52  const std::string& format,
53  llvm::Function* calledFnc = nullptr);
54 
55 } // namespace llvm_utils
56 } // namespace bin2llvmir
57 } // namespace retdec
58 
59 #endif
ShPtr< Module > module
The current module.
Definition: hll_writer.cpp:100
The frontend-end part of the decompiler.
bool isStringArrayPointeType(const llvm::Type *t)
Definition: llvm.cpp:114
llvm::IntegerType * getCharType(llvm::LLVMContext &ctx)
Definition: llvm.cpp:72
bool isCharType(const llvm::Type *t)
Definition: llvm.cpp:86
std::vector< llvm::Type * > parseFormatString(llvm::Module *module, const std::string &format, llvm::Function *calledFnc=nullptr)
Definition: llvm.cpp:423
bool isStringArrayType(const llvm::Type *t)
Definition: llvm.cpp:104
llvm::Type * stringToLlvmTypeDefault(llvm::Module *m, const std::string &str)
Definition: llvm.cpp:124
llvm::Value * skipCasts(llvm::Value *val)
Definition: llvm.cpp:33
bool isCharPointerType(const llvm::Type *t)
Definition: llvm.cpp:95
llvm::Type * stringToLlvmType(llvm::LLVMContext &ctx, const std::string &str)
llvm::PointerType * getCharPointerType(llvm::LLVMContext &ctx)
Definition: llvm.cpp:77
Definition: archive_wrapper.h:19