retdec
int_to_fp_cast_expr.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_INT_TO_FP_CAST_EXPR_H
8 #define RETDEC_LLVMIR2HLL_IR_INT_TO_FP_CAST_EXPR_H
9 
13 
14 namespace retdec {
15 namespace llvmir2hll {
16 
17 class Expression;
18 class Visitor;
19 
26 class IntToFPCastExpr final: public CastExpr {
27 public:
29  enum class Variant {
30  SIToFP,
31  UIToFP
32  };
33 
36 
37  virtual bool isEqualTo(ShPtr<Value> otherValue) const override;
38  virtual ShPtr<Value> clone() override;
39 
40  Variant getVariant() const;
41 
44  virtual void accept(Visitor *v) override;
46 
47 private:
50 private:
51  // Since instances are created by calling the static function create(), the
52  // constructor can be private.
55 };
56 
57 } // namespace llvmir2hll
58 } // namespace retdec
59 
60 #endif
Base class for cast instructions.
Base class for cast instructions.
Definition: cast_expr.h:25
ShPtr< Expression > op
Operand.
Definition: cast_expr.h:45
ShPtr< Type > dstType
Destination type.
Definition: cast_expr.h:48
Cast of LLVM instruction SItoFP/UItoFP.
Definition: int_to_fp_cast_expr.h:26
Variant
Variants of the integer to floating point casts.
Definition: int_to_fp_cast_expr.h:29
@ UIToFP
Signed integer to floating-point.
IntToFPCastExpr(ShPtr< Expression > op, ShPtr< Type > dstType, Variant variant=Variant::UIToFP)
Constructs a cast operator of LLVM instructions SItoFP/UItoFP.
Definition: int_to_fp_cast_expr.cpp:19
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: int_to_fp_cast_expr.cpp:23
static ShPtr< IntToFPCastExpr > create(ShPtr< Expression > op, ShPtr< Type > dstType, Variant variant=Variant::UIToFP)
Creates a new cast operator of LLVM instructions SItoFP/UItoFP.
Definition: int_to_fp_cast_expr.cpp:59
Variant getVariant() const
Returns variant of the integer to floating point cast.
Definition: int_to_fp_cast_expr.cpp:45
virtual ShPtr< Value > clone() override
Clones the cast operator.
Definition: int_to_fp_cast_expr.cpp:35
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: int_to_fp_cast_expr.cpp:73
Variant variant
Variant of the cast.
Definition: int_to_fp_cast_expr.h:49
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.