retdec
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
retdec::llvmir2hll::IntToFPCastExpr Class Referencefinal

Cast of LLVM instruction SItoFP/UItoFP. More...

#include <int_to_fp_cast_expr.h>

Inheritance diagram for retdec::llvmir2hll::IntToFPCastExpr:
Inheritance graph
[legend]
Collaboration diagram for retdec::llvmir2hll::IntToFPCastExpr:
Collaboration graph
[legend]

Public Types

enum class  Variant { SIToFP , UIToFP }
 Variants of the integer to floating point casts. More...
 
- Public Types inherited from retdec::llvmir2hll::Subject< Value >
using ConcreteObserver = Observer< Value, Value >
 A concrete observer. More...
 
using ObserverPtr = WkPtr< ConcreteObserver >
 A pointer to an observer. More...
 

Public Member Functions

virtual bool isEqualTo (ShPtr< Value > otherValue) const override
 Returns true if this value is equal to otherValue, false otherwise. More...
 
virtual ShPtr< Valueclone () override
 Clones the cast operator. More...
 
Variant getVariant () const
 Returns variant of the integer to floating point cast. More...
 
Visitor Interface
virtual void accept (Visitor *v) override
 Visitor pattern implementation. More...
 
- Public Member Functions inherited from retdec::llvmir2hll::CastExpr
virtual ShPtr< TypegetType () const override
 Returns the type of the expression. More...
 
virtual void replace (ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
 Replaces all occurrences of oldExpr with newExpr in the current expression. More...
 
void setOperand (ShPtr< Expression > newOp)
 Sets a new operand. More...
 
ShPtr< ExpressiongetOperand () const
 Returns the operand. More...
 
virtual void update (ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override
 Updates the cast according to the changes of subject. More...
 
- Public Member Functions inherited from retdec::llvmir2hll::Value
virtual ~Value ()=default
 
virtual ShPtr< ValuegetSelf () override
 Returns a shared pointer of self. More...
 
std::string getTextRepr ()
 Returns a textual representation of the value. More...
 
- Public Member Functions inherited from retdec::llvmir2hll::Metadatable< std::string >
void setMetadata (std::string data)
 Attaches new metadata. More...
 
std::string getMetadata () const
 Returns the attached metadata. More...
 
bool hasMetadata () const
 Are there any non-empty metadata? More...
 
- Public Member Functions inherited from retdec::llvmir2hll::Observer< Value >
 Observer ()=default
 Creates a new observer. More...
 
virtual ~Observer ()=default
 Destructs the observer. More...
 
- Public Member Functions inherited from retdec::llvmir2hll::Subject< Value >
 Subject ()
 Creates a new subject. More...
 
virtual ~Subject ()=default
 Destructs the subject. More...
 
void addObserver (ObserverPtr observer)
 Adds a new observer to the list of observers. More...
 
void removeObserver (ObserverPtr observer)
 Removes the selected observer from the list of observers. More...
 
void removeObservers ()
 Removes all observers. More...
 
void notifyObservers (ShPtr< Value > arg=nullptr)
 Notifies all observers by calling Observer::update() on them. More...
 

Static Public Member Functions

static ShPtr< IntToFPCastExprcreate (ShPtr< Expression > op, ShPtr< Type > dstType, Variant variant=Variant::UIToFP)
 Creates a new cast operator of LLVM instructions SItoFP/UItoFP. More...
 
- Static Public Member Functions inherited from retdec::llvmir2hll::Expression
static void replaceExpression (ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr)
 Replaces oldExpr with newExpr. More...
 

Private Member Functions

 IntToFPCastExpr (ShPtr< Expression > op, ShPtr< Type > dstType, Variant variant=Variant::UIToFP)
 Constructs a cast operator of LLVM instructions SItoFP/UItoFP. More...
 

Private Attributes

Variant variant
 Variant of the cast. More...
 

Additional Inherited Members

- Protected Types inherited from retdec::llvmir2hll::Subject< Value >
using ObserverContainer = std::vector< ObserverPtr >
 A container to store observers. More...
 
using observer_iterator = typename ObserverContainer::const_iterator
 
- Protected Member Functions inherited from retdec::llvmir2hll::CastExpr
 CastExpr (ShPtr< Expression > op, ShPtr< Type > dstType)
 Constructs a cast operator. More...
 
- Protected Member Functions inherited from retdec::llvmir2hll::Expression
 Expression ()=default
 
- Protected Member Functions inherited from retdec::llvmir2hll::Value
 Value ()=default
 
- Protected Member Functions inherited from retdec::llvmir2hll::Visitable
 Visitable ()=default
 
 ~Visitable ()=default
 
- Protected Member Functions inherited from retdec::llvmir2hll::Metadatable< std::string >
 Metadatable ()
 Constructs a new metadatable object. More...
 
- Protected Member Functions inherited from retdec::llvmir2hll::Subject< Value >
observer_iterator observer_begin () const
 Returns a constant iterator to the first observer. More...
 
observer_iterator observer_end () const
 Returns a constant iterator past the last observer. More...
 
- Protected Attributes inherited from retdec::llvmir2hll::CastExpr
ShPtr< Expressionop
 Operand. More...
 
ShPtr< TypedstType
 Destination type. More...
 

Detailed Description

Cast of LLVM instruction SItoFP/UItoFP.

Use create() to create instances. Instances of this class have reference object semantics. This class is not meant to be subclassed.

Member Enumeration Documentation

◆ Variant

Variants of the integer to floating point casts.

Enumerator
SIToFP 
UIToFP 

Signed integer to floating-point.

Unsigned integer to floating-point.

Constructor & Destructor Documentation

◆ IntToFPCastExpr()

retdec::llvmir2hll::IntToFPCastExpr::IntToFPCastExpr ( ShPtr< Expression op,
ShPtr< Type dstType,
Variant  variant = Variant::UIToFP 
)
private

Constructs a cast operator of LLVM instructions SItoFP/UItoFP.

See create() for more information.

Member Function Documentation

◆ accept()

void retdec::llvmir2hll::IntToFPCastExpr::accept ( Visitor v)
overridevirtual

Visitor pattern implementation.

Subclasses should implement this method as:

v->visit(ucast<T>(shared_from_this()));

where T is the name of the subclass, and shared_from_this() and ucast<> are from Decompiler/Support/SmartPtr.h.

Implements retdec::llvmir2hll::Visitable.

◆ clone()

ShPtr< Value > retdec::llvmir2hll::IntToFPCastExpr::clone ( )
overridevirtual

Clones the cast operator.

Implements retdec::llvmir2hll::Value.

◆ create()

ShPtr< IntToFPCastExpr > retdec::llvmir2hll::IntToFPCastExpr::create ( ShPtr< Expression op,
ShPtr< Type dstType,
Variant  variant = Variant::UIToFP 
)
static

Creates a new cast operator of LLVM instructions SItoFP/UItoFP.

Parameters
[in]opOperand.
[in]dstTypeDestination type.
[in]variantVariant of the cast.
Preconditions
  • op is non-null

◆ getVariant()

IntToFPCastExpr::Variant retdec::llvmir2hll::IntToFPCastExpr::getVariant ( ) const

Returns variant of the integer to floating point cast.

◆ isEqualTo()

bool retdec::llvmir2hll::IntToFPCastExpr::isEqualTo ( ShPtr< Value otherValue) const
overridevirtual

Returns true if this value is equal to otherValue, false otherwise.

This member function brings the support of value object semantics into reference objects, namely equality based not only on identity.

This function doesn't consider observers, metadata, etc.

Implements retdec::llvmir2hll::Value.

Member Data Documentation

◆ variant

Variant retdec::llvmir2hll::IntToFPCastExpr::variant
private

Variant of the cast.


The documentation for this class was generated from the following files: