retdec
|
A bit right shift operator. More...
#include <bit_shr_op_expr.h>
Public Types | |
enum class | Variant { Arithmetical , Logical } |
Variants of the operator. 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 |
Returns a clone of the value. More... | |
Variant | getVariant () const |
Returns the variant of the operator. More... | |
bool | isLogical () const |
Returns true if the shift is logical, false otherwise. More... | |
bool | isArithmetical () const |
Returns true if the shift is logical, false otherwise. 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... | |
ShPtr< Expression > | getFirstOperand () const |
Returns the first operand. More... | |
ShPtr< Expression > | getSecondOperand () const |
Returns the second operand. More... | |
void | setFirstOperand (ShPtr< Expression > first) |
Sets the first operand. More... | |
void | setSecondOperand (ShPtr< Expression > second) |
Sets the second operand. More... | |
virtual void | update (ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override |
Updates the operator 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< BitShrOpExpr > | create (ShPtr< Expression > op1, ShPtr< Expression > op2, Variant variant=Variant::Arithmetical) |
Creates a new bit right shift operator. More... | |
![]() | |
static void | replaceExpression (ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) |
Replaces oldExpr with newExpr. More... | |
Private Member Functions | |
BitShrOpExpr (ShPtr< Expression > op1, ShPtr< Expression > op2, Variant variant=Variant::Arithmetical) | |
Constructs a bit right shift operator. More... | |
Private Attributes | |
Variant | variant |
Variant of the operator. More... | |
Additional Inherited Members | |
![]() | |
using | ObserverContainer = std::vector< ObserverPtr > |
A container to store observers. More... | |
using | observer_iterator = typename ObserverContainer::const_iterator |
![]() | |
BinaryOpExpr (ShPtr< Expression > op1, ShPtr< Expression > op2) | |
Constructs a binary 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 > | op1 |
First operand. More... | |
ShPtr< Expression > | op2 |
Second operand. More... | |
A bit right shift operator.
This operator has the same meaning as the '>>' operator in C. However, it contains an additional flag that determines whether the shift is arithmetical or logical. Recall that in C, this is implementation defined.
Instances of this class have reference object semantics.
|
strong |
|
private |
Constructs a bit right shift operator.
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.
Returns a clone of the value.
A clone is (in most cases) an exact copy of the value. This member function provides the copy mechanism for reference objects.
The following parts of values are not cloned:
The following subclasses of Value are not cloned, i.e. they are returned without any copying:
Statements in compound statements (i.e. statements where isCompound()
returns true
) are cloned without their successors; therefore, e.g., just the first statement of every if's clause is cloned.
Implements retdec::llvmir2hll::Value.
|
static |
Creates a new bit right shift operator.
[in] | op1 | First operand. |
[in] | op2 | Second operand. |
[in] | variant | Variant of the operator |
BitShrOpExpr::Variant retdec::llvmir2hll::BitShrOpExpr::getVariant | ( | ) | const |
Returns the variant of the operator.
bool retdec::llvmir2hll::BitShrOpExpr::isArithmetical | ( | ) | const |
Returns true
if the shift is logical, false
otherwise.
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.
bool retdec::llvmir2hll::BitShrOpExpr::isLogical | ( | ) | const |
Returns true
if the shift is logical, false
otherwise.
|
private |
Variant of the operator.