retdec
|
Cast of LLVM Ext instructions. More...
#include <ext_cast_expr.h>
Public Types | |
enum class | Variant { ZExt , SExt , FPExt } |
Variants of the cast. More... | |
![]() | |
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< Value > | clone () override |
Clones the cast operator. More... | |
Variant | getVariant () const |
Returns the variant of the cast. More... | |
Visitor Interface | |
virtual void | accept (Visitor *v) override |
Visitor pattern implementation. More... | |
![]() | |
virtual ShPtr< Type > | getType () 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< Expression > | getOperand () 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... | |
![]() | |
virtual | ~Value ()=default |
virtual ShPtr< Value > | getSelf () override |
Returns a shared pointer of self. More... | |
std::string | getTextRepr () |
Returns a textual representation of the value. More... | |
![]() | |
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... | |
![]() | |
Observer ()=default | |
Creates a new observer. More... | |
virtual | ~Observer ()=default |
Destructs the observer. More... | |
![]() | |
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< ExtCastExpr > | create (ShPtr< Expression > op, ShPtr< Type > dstType, Variant variant=Variant::ZExt) |
Creates a new cast operand of LLVM Ext instructions. More... | |
![]() | |
static void | replaceExpression (ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) |
Replaces oldExpr with newExpr. More... | |
Private Member Functions | |
ExtCastExpr (ShPtr< Expression > op, ShPtr< Type > dstType, Variant variant=Variant::ZExt) | |
Constructs a cast operator of LLVM Ext instructions. More... | |
Private Attributes | |
Variant | variant |
Variant of the cast. More... | |
Additional Inherited Members | |
![]() | |
using | ObserverContainer = std::vector< ObserverPtr > |
A container to store observers. More... | |
using | observer_iterator = typename ObserverContainer::const_iterator |
![]() | |
CastExpr (ShPtr< Expression > op, ShPtr< Type > dstType) | |
Constructs a cast operator. More... | |
![]() | |
Expression ()=default | |
![]() | |
Value ()=default | |
![]() | |
Visitable ()=default | |
~Visitable ()=default | |
![]() | |
Metadatable () | |
Constructs a new metadatable object. More... | |
![]() | |
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... | |
![]() | |
ShPtr< Expression > | op |
Operand. More... | |
ShPtr< Type > | dstType |
Destination type. More... | |
Cast of LLVM Ext instructions.
Use create() to create instances. Instances of this class have reference object semantics. This class is not meant to be subclassed.
|
strong |
|
private |
Constructs a cast operator of LLVM Ext instructions.
See create() for more information.
|
overridevirtual |
Visitor pattern implementation.
Subclasses should implement this method as:
where T
is the name of the subclass, and shared_from_this() and ucast<>
are from Decompiler/Support/SmartPtr.h.
Implements retdec::llvmir2hll::Visitable.
Clones the cast operator.
Implements retdec::llvmir2hll::Value.
|
static |
Creates a new cast operand of LLVM Ext instructions.
[in] | op | Operand. |
[in] | dstType | Destination type. |
[in] | variant | Variant of the cast. |
ExtCastExpr::Variant retdec::llvmir2hll::ExtCastExpr::getVariant | ( | ) | const |
Returns the variant of the cast.
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.
|
private |
Variant of the cast.