retdec
llvm_type_converter.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_LLVM_LLVMIR2BIR_CONVERTER_LLVM_TYPE_CONVERTER_H
8 #define RETDEC_LLVMIR2HLL_LLVM_LLVMIR2BIR_CONVERTER_LLVM_TYPE_CONVERTER_H
9 
10 #include <unordered_map>
11 
14 
15 namespace llvm {
16 
17 class ArrayType;
18 class FunctionType;
19 class IntegerType;
20 class PointerType;
21 class StructType;
22 class Type;
23 
24 } // namespace llvm
25 
26 namespace retdec {
27 namespace llvmir2hll {
28 
29 class ArrayType;
30 class FunctionType;
31 class PointerType;
32 class StructType;
33 class Type;
34 
39 public:
41 
42  bool isBool(const llvm::IntegerType *type) const;
43 
44  ShPtr<Type> convert(const llvm::Type *type);
45  ShPtr<PointerType> convert(const llvm::PointerType *type);
46  ShPtr<ArrayType> convert(const llvm::ArrayType *type);
47  ShPtr<StructType> convert(const llvm::StructType *type);
48  ShPtr<FunctionType> convert(const llvm::FunctionType *type);
49 
50 private:
52  std::unordered_map<const llvm::Type *, ShPtr<Type>> mapLLVMTypeToType;
53 };
54 
55 } // namespace llvmir2hll
56 } // namespace retdec
57 
58 #endif
A converter from LLVM type to type in BIR.
Definition: llvm_type_converter.h:38
bool isBool(const llvm::IntegerType *type) const
Determines whether LLVM integral type type is boolean.
Definition: llvm_type_converter.cpp:35
std::unordered_map< const llvm::Type *, ShPtr< Type > > mapLLVMTypeToType
Mapping of an LLVM type into an already converted type in BIR.
Definition: llvm_type_converter.h:52
ShPtr< Type > convert(const llvm::Type *type)
Converts the given LLVM type type into a type in BIR.
Definition: llvm_type_converter.cpp:47
LLVMTypeConverter()
Constructs a new converter.
Definition: llvm_type_converter.cpp:27
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.