retdec
unknown_type.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_UNKNOWN_TYPE_H
8 #define RETDEC_LLVMIR2HLL_IR_UNKNOWN_TYPE_H
9 
10 #include <cstddef>
11 #include <map>
12 
15 
16 namespace retdec {
17 namespace llvmir2hll {
18 
19 class Visitor;
20 
27 class UnknownType final: public Type {
28 public:
29  static ShPtr<UnknownType> create();
30 
31  virtual ShPtr<Value> clone() override;
32 
33  virtual bool isEqualTo(ShPtr<Value> otherValue) const override;
34 
35  std::size_t getSize() const;
36 
39  virtual void accept(Visitor *v) override;
41 
42 private:
43  // Since instances are created by calling the static function create(), the
44  // constructor can be private.
45  UnknownType();
46 };
47 
48 } // namespace llvmir2hll
49 } // namespace retdec
50 
51 #endif
A base class of all types.
Definition: type.h:20
A representation of an Unknown type.
Definition: unknown_type.h:27
std::size_t getSize() const
Returns the number of bits.
Definition: unknown_type.cpp:36
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: unknown_type.cpp:26
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: unknown_type.cpp:22
UnknownType()
Constructs a new Unknown type.
Definition: unknown_type.cpp:19
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: unknown_type.cpp:51
static ShPtr< UnknownType > create()
Creates a new unknown type.
Definition: unknown_type.cpp:46
A base class of all visitors.
Definition: visitor.h:95
A base class of all types.
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
Declarations, aliases, macros, etc. for the use of smart pointers.