7 #ifndef RETDEC_LLVMIR2HLL_IR_CONST_FLOAT_H
8 #define RETDEC_LLVMIR2HLL_IR_CONST_FLOAT_H
13 #include <llvm/ADT/APFloat.h>
37 using Type = llvm::APFloat;
51 std::string
toString(
unsigned precision = 0,
unsigned maxPadding = 0)
const;
A float constant.
Definition: const_float.h:31
bool isNegativeOne() const
Determines whether the float constant is negative one.
Definition: const_float.cpp:225
void flipSign()
Flip the sign of value.
Definition: const_float.cpp:208
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: const_float.cpp:69
ToStringArgs getToStringArgsForMostReadableString() const
Returns the arguments for which toString() returns the most readable string.
Definition: const_float.cpp:176
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current expression.
Definition: const_float.cpp:84
ConstFloat(Type value)
Constructs a float constant initialized to the given value.
Definition: const_float.cpp:60
bool isPositive() const
Determines whether the float constant is positive (> 0).
Definition: const_float.cpp:233
virtual ShPtr< retdec::llvmir2hll::Type > getType() const override
Returns the type of the expression.
Definition: const_float.cpp:80
Type getValue() const
Returns the constant's value.
Definition: const_float.cpp:93
bool isNegative() const
Determines whether the float constant is negative (< 0).
Definition: const_float.cpp:217
std::string toString(unsigned precision=0, unsigned maxPadding=0) const
Converts the constant into a decimal string.
Definition: const_float.cpp:132
std::string toMostReadableString() const
Converts the constant into the most readable decimal representation.
Definition: const_float.cpp:155
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: const_float.cpp:253
static ShPtr< ConstFloat > create(Type value)
Constructs a float constant initialized to the given value.
Definition: const_float.cpp:249
llvm::APFloat Type
Underlying floating-point type.
Definition: const_float.h:37
ShPtr< FloatType > type
Type of the constant.
Definition: const_float.h:75
bool isZero() const
Determines whether the float constant is zero.
Definition: const_float.cpp:240
std::pair< unsigned, unsigned > ToStringArgs
Arguments of toString().
Definition: const_float.h:68
unsigned getSize() const
Returns the number of bits of the constant's type.
Definition: const_float.cpp:100
Type value
Value of the constant.
Definition: const_float.h:72
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: const_float.cpp:63
A base class for all constants.
Definition: constant.h:20
A base class of all visitors.
Definition: visitor.h:95
A base class for all constants.
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.