7 #ifndef RETDEC_LLVMIR2HLL_LLVM_LLVMIR2BIR_CONVERTER_BASIC_BLOCK_CONVERTER_H
8 #define RETDEC_LLVMIR2HLL_LLVM_LLVMIR2BIR_CONVERTER_BASIC_BLOCK_CONVERTER_H
10 #include <llvm/IR/InstVisitor.h>
19 class InsertValueInst;
24 class UnreachableInst;
32 class LLVMValueConverter;
42 private llvm::InstVisitor<BasicBlockConverter, ShPtr<Statement>> {
63 llvm::InsertValueInst &inst);
A converter of LLVM basic blocks.
Definition: basic_block_converter.h:42
ShPtr< LLVMValueConverter > converter
A converter from LLVM values to values in BIR.
Definition: basic_block_converter.h:66
BasicBlockConverter(ShPtr< LLVMValueConverter > converter, ShPtr< LabelsHandler > labelsHandler)
Constructs a new basic block converter.
Definition: basic_block_converter.cpp:32
ShPtr< Statement > visitStoreInst(llvm::StoreInst &inst)
Converts the given LLVM store instruction inst into an assign statement in BIR.
Definition: basic_block_converter.cpp:175
ShPtr< Statement > visitInstruction(llvm::Instruction &inst)
Converts the given LLVM instruction inst into an assign statement in BIR. This method converts other ...
Definition: basic_block_converter.cpp:199
ShPtr< Statement > convertInstructionsOf(llvm::BasicBlock &bb)
Converts instruction of the given LLVM basic block bb into a sequence of statements in BIR.
Definition: basic_block_converter.cpp:77
ShPtr< Statement > visitCallInst(llvm::CallInst &inst)
Converts the given LLVM call instruction inst into a statement in BIR.
Definition: basic_block_converter.cpp:94
bool shouldBeConverted(const llvm::Instruction &inst) const
Determines whether the given LLVM instruction inst should be converted by BasicBlockConverter.
Definition: basic_block_converter.cpp:65
ShPtr< Statement > visitLoadInst(llvm::LoadInst &inst)
Converts the given LLVM load instruction inst into an assign statement in BIR.
Definition: basic_block_converter.cpp:149
ShPtr< Statement > visitReturnInst(llvm::ReturnInst &inst)
Converts the given LLVM return instruction inst into a statement in BIR.
Definition: basic_block_converter.cpp:162
ShPtr< Statement > convert(llvm::BasicBlock &bb)
Converts the given LLVM basic block bb into a sequence of statements in BIR.
Definition: basic_block_converter.cpp:40
ShPtr< Statement > generateAssignOfPrevValForInsertValueInst(llvm::InsertValueInst &inst)
Generates assignment of previous value to aggregate type expression for the given LLVM insertvalue in...
Definition: basic_block_converter.cpp:209
ShPtr< Statement > visitUnreachableInst(llvm::UnreachableInst &inst)
Converts the given LLVM unreachable instruction inst into an unreachable statement in BIR.
Definition: basic_block_converter.cpp:191
ShPtr< Statement > visitInsertValueInst(llvm::InsertValueInst &inst)
Converts the given LLVM insertvalue instruction inst into two assign statements in BIR.
Definition: basic_block_converter.cpp:132
ShPtr< LabelsHandler > labelsHandler
A handler of labels.
Definition: basic_block_converter.h:69
A representation of a program statement.
Definition: statement.h:39
A mixin to make classes non-copyable.
Definition: non_copyable.h:27
Definition: itanium_ast_ctypes_parser.h:12
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
Definition: archive_wrapper.h:19
A mixin to make classes non-copyable.
Declarations, aliases, macros, etc. for the use of smart pointers.