retdec
ctypes2llvm.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_CTYPES2LLVM_H
8 #define RETDEC_CTYPES2LLVM_H
9 
10 #include <llvm/IR/Module.h>
11 
13 #include "retdec/ctypes/context.h"
14 #include "retdec/ctypes/module.h"
15 #include "retdec/ctypes/type.h"
16 #include "retdec/ctypes/visitor.h"
17 
18 namespace retdec {
19 namespace bin2llvmir {
20 
22 {
23 public:
24  Ctypes2LlvmTypeVisitor(llvm::Module* m, Config* c);
25  virtual ~Ctypes2LlvmTypeVisitor() override = default;
26 
27  virtual void visit(
28  const std::shared_ptr<retdec::ctypes::ArrayType>&) override;
29  virtual void visit(
30  const std::shared_ptr<retdec::ctypes::EnumType>&) override;
31  virtual void visit(
32  const std::shared_ptr<retdec::ctypes::FloatingPointType>&) override;
33  virtual void visit(
34  const std::shared_ptr<retdec::ctypes::FunctionType>&) override;
35  virtual void visit(
36  const std::shared_ptr<retdec::ctypes::IntegralType>&) override;
37  virtual void visit(
38  const std::shared_ptr<retdec::ctypes::NamedType>&) override;
39  virtual void visit(
40  const std::shared_ptr<retdec::ctypes::PointerType>&) override;
41  virtual void visit(
42  const std::shared_ptr<retdec::ctypes::ReferenceType>&) override;
43  virtual void visit(
44  const std::shared_ptr<retdec::ctypes::StructType>&) override;
45  virtual void visit(
46  const std::shared_ptr<retdec::ctypes::TypedefedType>&) override;
47  virtual void visit(
48  const std::shared_ptr<retdec::ctypes::UnionType>&) override;
49  virtual void visit(
50  const std::shared_ptr<retdec::ctypes::UnknownType>&) override;
51  virtual void visit(
52  const std::shared_ptr<retdec::ctypes::VoidType>&) override;
53 
54  llvm::Type* getLlvmType() const;
55 
56 private:
57  llvm::Module* _module = nullptr;
58  Config* _config = nullptr;
59  llvm::Type* _type = nullptr;
60 };
61 
62 }
63 }
64 
65 #endif //RETDEC_CTYPES_TO_LLVM_H
Config DB provider for bin2llvmirl.
Definition: config.h:24
Definition: ctypes2llvm.h:22
llvm::Module * _module
Definition: ctypes2llvm.h:57
virtual ~Ctypes2LlvmTypeVisitor() override=default
llvm::Type * getLlvmType() const
Definition: ctypes2llvm.cpp:207
Config * _config
Definition: ctypes2llvm.h:58
llvm::Type * _type
Definition: ctypes2llvm.h:59
Ctypes2LlvmTypeVisitor(llvm::Module *m, Config *c)
Definition: ctypes2llvm.cpp:12
virtual void visit(const std::shared_ptr< retdec::ctypes::ArrayType > &) override
Definition: ctypes2llvm.cpp:21
A base class of all C-types' visitors.
Definition: visitor.h:33
Container for all C functions and types.
Main class for C functions representation.
A base class of all C types.
A base class of all visitors.
The frontend-end part of the decompiler.
Definition: archive_wrapper.h:19