ROSE  0.11.145.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators Class Reference

Description

Definition at line 42 of file LlvmSemantics.h.

Inheritance diagram for Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators:
Collaboration graph
[legend]

Classes

struct  Indent
 Cause indentation until this object is destroyed. More...
 

Public Types

using Super = SymbolicSemantics::RiscOperators
 Base type. More...
 
using Ptr = RiscOperatorsPtr
 Shared-ownership pointer. More...
 
- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators
using Super = BaseSemantics::RiscOperators
 Base type. More...
 
using Ptr = RiscOperatorsPtr
 Shared-ownership pointer. More...
 
- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RiscOperators
enum  IteStatus {
  IteStatus::NEITHER,
  IteStatus::A,
  IteStatus::B,
  IteStatus::BOTH
}
 Status for iteWithStatus operation. More...
 
using Ptr = RiscOperatorsPtr
 Shared-ownership pointer. More...
 

Public Member Functions

virtual BaseSemantics::RiscOperatorsPtr create (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const override
 Virtual allocating constructor. More...
 
virtual BaseSemantics::RiscOperatorsPtr create (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const override
 Virtual allocating constructor. More...
 
virtual BaseSemantics::SValuePtr readMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, const BaseSemantics::SValuePtr &cond) override
 Reads a value from memory. More...
 
virtual void writeMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) override
 Writes a value to memory. More...
 
int indent (int nlevels=1)
 Increase indentation by nlevels levels. More...
 
std::string prefix () const
 Return indentation string. More...
 
virtual void reset ()
 Reset to initial state. More...
 
virtual const RegisterDescriptors & get_important_registers ()
 Return the list of registers that needs to be emitted to LLVM. More...
 
virtual RegisterDescriptors get_stored_registers ()
 Return the list of important registers that are stored. More...
 
virtual RegisterDescriptors get_modified_registers ()
 Return the list of important registers that have been modified since the last call to make_current(). More...
 
virtual RegisterDescriptor get_insn_pointer_register ()
 Return the descriptor for the instruction pointer register. More...
 
virtual SValuePtr get_instruction_pointer ()
 Return the value of the instruction pointer. More...
 
virtual const TreeNodes & get_memory_writes ()
 Return the list of memory writes that have occured since the last call to make_current(). More...
 
virtual void make_current ()
 Mark the current state as having been emitted. More...
 
virtual void add_rewrite (const ExpressionPtr &from, const LeafPtr &to)
 Register a rewrite. More...
 
virtual std::string add_variable (const LeafPtr &)
 Register an LLVM variable. More...
 
virtual std::string get_variable (const LeafPtr &)
 Returns the LLVM name for a variable, including the sigil. More...
 
virtual void emit_register_declarations (std::ostream &, const RegisterDescriptors &)
 Output LLVM global register declarations for the specified registers. More...
 
virtual void emit_register_definitions (std::ostream &, const RegisterDescriptors &)
 Output LLVM global register definitions for the specified registers. More...
 
virtual void emit_prerequisites (std::ostream &, const RegisterDescriptors &, const RegisterDictionaryPtr &)
 Output LLVM global variable reads that are needed to define the specified registers and pending memory writes. More...
 
virtual void emit_next_eip (std::ostream &, SgAsmInstruction *latest_insn)
 Output an LLVM branch instruction. More...
 
virtual void emit_memory_writes (std::ostream &)
 Output changed memory state. More...
 
virtual void emit_changed_state (std::ostream &)
 Output LLVM to bring the LLVM state up to date with respect to the ROSE state. More...
 
virtual std::string llvm_integer_type (size_t nbits)
 Obtain the LLVM type name for an integer. More...
 
virtual std::string llvm_term (const ExpressionPtr &)
 Convert a ROSE variable or integer to an LLVM term. More...
 
virtual std::string llvm_lvalue (const LeafPtr &)
 Convert a ROSE variable to an LLVM lvalue. More...
 
virtual LeafPtr next_temporary (size_t nbits)
 Create a temporary variable. More...
 
virtual std::string next_label ()
 Obtain the name for an LLVM label, excluding the "%" sigil. More...
 
virtual std::string addr_label (rose_addr_t)
 Obtain a label for a virtual address. More...
 
virtual std::string function_label (SgAsmFunction *)
 Obtain a label for a function. More...
 
int llvmVersion () const
 Property: LLVM version. More...
 
void llvmVersion (int v)
 Property: LLVM version. More...
 
virtual LeafPtr emit_expression (std::ostream &, const SValuePtr &)
 Emit LLVM statements for an expression. More...
 
virtual LeafPtr emit_expression (std::ostream &, const ExpressionPtr &)
 Emit LLVM statements for an expression. More...
 
virtual LeafPtr emit_expression (std::ostream &, const LeafPtr &)
 Emit LLVM statements for an expression. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators
virtual BaseSemantics::SValuePtr boolean_ (bool b) override
 Returns a Boolean value. More...
 
virtual BaseSemantics::SValuePtr number_ (size_t nbits, uint64_t value) override
 Returns a number of the specified bit width. More...
 
SValuePtr svalueExpr (const ExprPtr &expr, const InsnSet &defs=InsnSet())
 
bool getset_omit_cur_insn (bool b)
 
virtual void substitute (const SValuePtr &from, const SValuePtr &to)
 Substitute all occurrences of from with to in the current state. More...
 
virtual BaseSemantics::SValuePtr filterResult (const BaseSemantics::SValuePtr &)
 Filters results from RISC operators. More...
 
virtual SymbolicExpression::Type sgTypeToSymbolicType (SgAsmType *)
 Convert a SgAsmType to a symbolic type. More...
 
virtual void interrupt (int majr, int minr) override
 Invoked for instructions that cause an interrupt. More...
 
virtual BaseSemantics::SValuePtr and_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Computes bit-wise AND of two values. More...
 
virtual BaseSemantics::SValuePtr or_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Computes bit-wise OR of two values. More...
 
virtual BaseSemantics::SValuePtr xor_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Computes bit-wise XOR of two values. More...
 
virtual BaseSemantics::SValuePtr invert (const BaseSemantics::SValuePtr &a_) override
 One's complement. More...
 
virtual BaseSemantics::SValuePtr extract (const BaseSemantics::SValuePtr &a_, size_t begin_bit, size_t end_bit) override
 Extracts bits from a value. More...
 
virtual BaseSemantics::SValuePtr concat (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Concatenates the bits of two values. More...
 
virtual BaseSemantics::SValuePtr leastSignificantSetBit (const BaseSemantics::SValuePtr &a_) override
 Returns position of least significant set bit; zero when no bits are set. More...
 
virtual BaseSemantics::SValuePtr mostSignificantSetBit (const BaseSemantics::SValuePtr &a_) override
 Returns position of most significant set bit; zero when no bits are set. More...
 
virtual BaseSemantics::SValuePtr rotateLeft (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
 Rotate bits to the left. More...
 
virtual BaseSemantics::SValuePtr rotateRight (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
 Rotate bits to the right. More...
 
virtual BaseSemantics::SValuePtr shiftLeft (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
 Returns arg shifted left. More...
 
virtual BaseSemantics::SValuePtr shiftRight (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
 Returns arg shifted right logically (no sign bit). More...
 
virtual BaseSemantics::SValuePtr shiftRightArithmetic (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override
 Returns arg shifted right arithmetically (with sign bit). More...
 
virtual BaseSemantics::SValuePtr equalToZero (const BaseSemantics::SValuePtr &a_) override
 Determines whether a value is equal to zero. More...
 
virtual BaseSemantics::SValuePtr iteWithStatus (const BaseSemantics::SValuePtr &sel_, const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, IteStatus &) override
 If-then-else with status. More...
 
virtual BaseSemantics::SValuePtr unsignedExtend (const BaseSemantics::SValuePtr &a_, size_t new_width) override
 Extend (or shrink) operand a so it is nbits wide by adding or removing high-order bits. More...
 
virtual BaseSemantics::SValuePtr signExtend (const BaseSemantics::SValuePtr &a_, size_t new_width) override
 Sign extends a value. More...
 
virtual BaseSemantics::SValuePtr add (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Adds two integers of equal size. More...
 
virtual BaseSemantics::SValuePtr addWithCarries (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, const BaseSemantics::SValuePtr &c_, BaseSemantics::SValuePtr &carry_out) override
 Add two values of equal size and a carry bit. More...
 
virtual BaseSemantics::SValuePtr negate (const BaseSemantics::SValuePtr &a_) override
 Two's complement. More...
 
virtual BaseSemantics::SValuePtr signedDivide (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Divides two signed values. More...
 
virtual BaseSemantics::SValuePtr signedModulo (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Calculates modulo with signed values. More...
 
virtual BaseSemantics::SValuePtr signedMultiply (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Multiplies two signed values. More...
 
virtual BaseSemantics::SValuePtr unsignedDivide (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Divides two unsigned values. More...
 
virtual BaseSemantics::SValuePtr unsignedModulo (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Calculates modulo with unsigned values. More...
 
virtual BaseSemantics::SValuePtr unsignedMultiply (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override
 Multiply two unsigned values. More...
 
virtual BaseSemantics::SValuePtr fpConvert (const BaseSemantics::SValuePtr &a, SgAsmFloatType *aType, SgAsmFloatType *retType) override
 Convert from one floating-point type to another. More...
 
virtual BaseSemantics::SValuePtr reinterpret (const BaseSemantics::SValuePtr &, SgAsmType *) override
 Reinterpret an expression as a different type. More...
 
virtual BaseSemantics::SValuePtr readRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
 Reads a value from a register. More...
 
virtual BaseSemantics::SValuePtr peekRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
 Obtain a register value without side effects. More...
 
virtual void writeRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &a_) override
 Writes a value to a register. More...
 
virtual BaseSemantics::SValuePtr peekMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) override
 Read memory without side effects. More...
 
BaseSemantics::SValuePtr readOrPeekMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, AllowSideEffects::Flag)
 
void computingDefiners (DefinersMode m)
 Property: Track which instructions define a semantic value. More...
 
DefinersMode computingDefiners () const
 Property: Track which instructions define a semantic value. More...
 
void computingMemoryWriters (WritersMode m)
 Property: Track which instructions write to each memory location. More...
 
WritersMode computingMemoryWriters () const
 Property: Track which instructions write to each memory location. More...
 
void computingRegisterWriters (WritersMode m)
 Property: Track latest writer to each register. More...
 
WritersMode computingRegisterWriters () const
 Property: Track latest writer to each register. More...
 
void trimThreshold (uint64_t n)
 Property: Maximum size of expressions. More...
 
uint64_t trimThreshold () const
 Property: Maximum size of expressions. More...
 
size_t nTrimmed () const
 Property: Number of symbolic expressions trimmed. More...
 
void nTrimmed (size_t n)
 Property: Number of symbolic expressions trimmed. More...
 
bool reinterpretMemoryReads () const
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
void reinterpretMemoryReads (bool b)
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
bool reinterpretRegisterReads () const
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
void reinterpretRegisterReads (bool b)
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RiscOperators
virtual SValuePtr protoval () const
 Property: Prototypical semantic value. More...
 
virtual void hash (Combinatorics::Hasher &)
 Compute hash of current state. More...
 
virtual void startInstruction (SgAsmInstruction *insn)
 Called at the beginning of every instruction. More...
 
virtual void finishInstruction (SgAsmInstruction *insn)
 Called at the end of every instruction. More...
 
virtual void comment (const std::string &)
 Inject a line comment into debugging streams. More...
 
virtual SValuePtr bottom_ (size_t nbits)
 Returns a data-flow bottom value. More...
 
virtual SValuePtr filterCallTarget (const SValuePtr &a)
 Invoked to filter call targets. More...
 
virtual SValuePtr filterReturnTarget (const SValuePtr &a)
 Invoked to filter return targets. More...
 
virtual SValuePtr filterIndirectJumpTarget (const SValuePtr &a)
 Invoked to filter indirect jumps. More...
 
virtual void hlt ()
 Invoked for the x86 HLT instruction. More...
 
virtual void cpuid ()
 Invoked for the x86 CPUID instruction. More...
 
virtual SValuePtr rdtsc ()
 Invoked for the x86 RDTSC instruction. More...
 
virtual std::pair< SValuePtr, SValuePtrsplit (const SValuePtr &a, size_t splitPoint)
 Split a value into two narrower values. More...
 
virtual SValuePtr countLeadingZeros (const SValuePtr &a)
 Count leading zero bits. More...
 
virtual SValuePtr countLeadingOnes (const SValuePtr &a)
 Count leading one bits. More...
 
virtual SValuePtr reverseElmts (const SValuePtr &a, size_t elmtNBits)
 Reverse parts of a value. More...
 
virtual SValuePtr ite (const SValuePtr &cond, const SValuePtr &a, const SValuePtr &b) final
 If-then-else. More...
 
virtual SValuePtr addCarry (const SValuePtr &a, const SValuePtr &b, SValuePtr &carryOut, SValuePtr &overflowed)
 Adds two integers of equal size and carry. More...
 
virtual SValuePtr subtract (const SValuePtr &minuend, const SValuePtr &subtrahend)
 Subtract one value from another. More...
 
virtual SValuePtr subtractCarry (const SValuePtr &minuend, const SValuePtr &subtrahend, SValuePtr &carryOut, SValuePtr &overflowed)
 Subtract one value from another and carry. More...
 
virtual void interrupt (const SValuePtr &majr, const SValuePtr &minr, const SValuePtr &enabled)
 Invoked for instructions that cause an interrupt. More...
 
virtual SValuePtr fpFromInteger (const SValuePtr &intValue, SgAsmFloatType *fpType)
 Construct a floating-point value from an integer value. More...
 
virtual SValuePtr fpToInteger (const SValuePtr &fpValue, SgAsmFloatType *fpType, const SValuePtr &dflt)
 Construct an integer value from a floating-point value. More...
 
virtual SValuePtr fpIsNan (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is a special not-a-number bit pattern. More...
 
virtual SValuePtr fpIsDenormalized (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is denormalized. More...
 
virtual SValuePtr fpIsZero (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is equal to zero. More...
 
virtual SValuePtr fpIsInfinity (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is infinity. More...
 
virtual SValuePtr fpSign (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Sign of floating-point value. More...
 
virtual SValuePtr fpEffectiveExponent (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Exponent of floating-point value. More...
 
virtual SValuePtr fpAdd (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Add two floating-point values. More...
 
virtual SValuePtr fpSubtract (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Subtract one floating-point value from another. More...
 
virtual SValuePtr fpMultiply (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Multiply two floating-point values. More...
 
virtual SValuePtr fpDivide (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Divide one floating-point value by another. More...
 
virtual SValuePtr fpSquareRoot (const SValuePtr &a, SgAsmFloatType *fpType)
 Square root. More...
 
virtual SValuePtr fpRoundTowardZero (const SValuePtr &a, SgAsmFloatType *fpType)
 Round toward zero. More...
 
virtual SValuePtr convert (const SValuePtr &a, SgAsmType *srcType, SgAsmType *dstType)
 Convert value from one type to another. More...
 
virtual SmtSolverPtr solver () const
 Property: Satisfiability module theory (SMT) solver. More...
 
virtual void solver (const SmtSolverPtr &s)
 Property: Satisfiability module theory (SMT) solver. More...
 
const HotPatchhotPatch () const
 Property: Post-instruction hot patches. More...
 
HotPatchhotPatch ()
 Property: Post-instruction hot patches. More...
 
void hotPatch (const HotPatch &hp)
 Property: Post-instruction hot patches. More...
 
virtual StatePtr currentState () const
 Property: Current semantic state. More...
 
virtual void currentState (const StatePtr &s)
 Property: Current semantic state. More...
 
virtual StatePtr initialState () const
 Property: Optional lazily updated initial state. More...
 
virtual void initialState (const StatePtr &s)
 Property: Optional lazily updated initial state. More...
 
virtual const std::string & name () const
 Property: Name used for debugging. More...
 
virtual void name (const std::string &s)
 Property: Name used for debugging. More...
 
void print (std::ostream &stream, const std::string prefix="") const
 Print multi-line output for this object.
 
virtual void print (std::ostream &stream, Formatter &fmt) const
 Print multi-line output for this object.
 
WithFormatter with_format (Formatter &fmt)
 Used for printing RISC operators with formatting. More...
 
WithFormatter operator+ (Formatter &fmt)
 Used for printing RISC operators with formatting. More...
 
WithFormatter operator+ (const std::string &linePrefix)
 Used for printing RISC operators with formatting. More...
 
virtual size_t nInsns () const
 Property: Number of instructions processed. More...
 
virtual void nInsns (size_t n)
 Property: Number of instructions processed. More...
 
virtual SgAsmInstructioncurrentInstruction () const
 Property: Current instruction. More...
 
virtual void currentInstruction (SgAsmInstruction *insn)
 Property: Current instruction. More...
 
virtual bool isNoopRead () const
 Property: No-op read. More...
 
virtual void isNoopRead (bool b)
 Property: No-op read. More...
 
virtual SValuePtr undefined_ (size_t nbits)
 Returns a new undefined value. More...
 
virtual SValuePtr unspecified_ (size_t nbits)
 Returns a new undefined value. More...
 
virtual SValuePtr concatLoHi (const SValuePtr &lowBits, const SValuePtr &highBits)
 Aliases for concatenation. More...
 
virtual SValuePtr concatHiLo (const SValuePtr &highBits, const SValuePtr &lowBits)
 Aliases for concatenation. More...
 
virtual SValuePtr isEqual (const SValuePtr &a, const SValuePtr &b)
 Equality comparison. More...
 
virtual SValuePtr isNotEqual (const SValuePtr &a, const SValuePtr &b)
 Equality comparison. More...
 
virtual SValuePtr isUnsignedLessThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isUnsignedLessThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isUnsignedGreaterThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isUnsignedGreaterThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isSignedLessThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr isSignedLessThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr isSignedGreaterThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr isSignedGreaterThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr readRegister (RegisterDescriptor reg)
 Reads a value from a register. More...
 
SValuePtr peekRegister (RegisterDescriptor reg)
 Obtain a register value without side effects. More...
 

Static Public Member Functions

static RiscOperatorsPtr instanceFromRegisters (const RegisterDictionaryPtr &, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object and configures it to use semantic values and states that are defaults for LlvmSemantics. More...
 
static RiscOperatorsPtr instanceFromProtoval (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object with specified prototypical values. More...
 
static RiscOperatorsPtr instanceFromState (const BaseSemantics::StatePtr &, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object with specified state. More...
 
static RiscOperatorsPtr promote (const BaseSemantics::RiscOperatorsPtr &)
 Run-time promotion of a base RiscOperators pointer to Llvm operators. More...
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators
static RiscOperatorsPtr instanceFromRegisters (const RegisterDictionaryPtr &, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object and configures it to use semantic values and states that are defaults for SymbolicSemantics. More...
 
static RiscOperatorsPtr instanceFromProtoval (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object with specified prototypical values. More...
 
static RiscOperatorsPtr instanceFromState (const BaseSemantics::StatePtr &, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object with specified state. More...
 
static RiscOperatorsPtr promote (const BaseSemantics::RiscOperatorsPtr &)
 Run-time promotion of a base RiscOperators pointer to symbolic operators. More...
 
static SgAsmFloatTypesgIsIeee754 (SgAsmType *)
 Tests whether a SgAsmType is an IEEE-754 floating-point type. More...
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RiscOperators
static RiscOperatorsPtr promote (const RiscOperatorsPtr &x)
 

Protected Member Functions

 RiscOperators (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &)
 
 RiscOperators (const BaseSemantics::StatePtr &, const SmtSolverPtr &)
 
virtual LeafPtr emit_assignment (std::ostream &, const ExpressionPtr &rhs)
 Emit an assignment and add a rewrite rule. More...
 
virtual ExpressionPtr emit_zero_extend (std::ostream &, const ExpressionPtr &value, size_t nbits)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_sign_extend (std::ostream &, const ExpressionPtr &value, size_t nbits)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_truncate (std::ostream &, const ExpressionPtr &value, size_t nbits)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_unsigned_resize (std::ostream &, const ExpressionPtr &value, size_t nbits)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_binary (std::ostream &, const std::string &llvm_op, const ExpressionPtr &, const ExpressionPtr &)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_signed_binary (std::ostream &, const std::string &llvm_op, const ExpressionPtr &, const ExpressionPtr &)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_unsigned_binary (std::ostream &, const std::string &llvm_op, const ExpressionPtr &, const ExpressionPtr &)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_logical_right_shift (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &amount)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_logical_right_shift_ones (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &amount)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_arithmetic_right_shift (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &amount)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_left_shift (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &amount)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_left_shift_ones (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &amount)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_lssb (std::ostream &, const ExpressionPtr &)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_mssb (std::ostream &, const ExpressionPtr &)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_extract (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &from, size_t result_nbits)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_invert (std::ostream &, const ExpressionPtr &value)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_left_associative (std::ostream &, const std::string &llvm_op, const TreeNodes &operands)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_concat (std::ostream &, TreeNodes operands)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_signed_divide (std::ostream &, const ExpressionPtr &numerator, const ExpressionPtr &denominator)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_unsigned_divide (std::ostream &, const ExpressionPtr &numerator, const ExpressionPtr &denominator)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_signed_modulo (std::ostream &, const ExpressionPtr &numerator, const ExpressionPtr &denominator)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_unsigned_modulo (std::ostream &, const ExpressionPtr &numerator, const ExpressionPtr &denominator)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_signed_multiply (std::ostream &, const TreeNodes &operands)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_unsigned_multiply (std::ostream &, const TreeNodes &operands)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_rotate_left (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &amount)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_rotate_right (std::ostream &, const ExpressionPtr &value, const ExpressionPtr &amount)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_compare (std::ostream &, const std::string &llvm_op, const ExpressionPtr &, const ExpressionPtr &)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_ite (std::ostream &, const ExpressionPtr &cond, const ExpressionPtr &, const ExpressionPtr &)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_memory_read (std::ostream &, const ExpressionPtr &address, size_t nbits)
 Emit an operation as LLVM instructions. More...
 
virtual ExpressionPtr emit_global_read (std::ostream &, const std::string &varname, size_t nbits)
 Emit an operation as LLVM instructions. More...
 
virtual void emit_memory_write (std::ostream &, const ExpressionPtr &address, const ExpressionPtr &value)
 Emit an operation as LLVM instructions. More...
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators
 RiscOperators (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver)
 
 RiscOperators (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver)
 
SValuePtr svalueUndefined (size_t nbits)
 
SValuePtr svalueBottom (size_t nbits)
 
SValuePtr svalueUnspecified (size_t nbits)
 
SValuePtr svalueNumber (size_t nbits, uint64_t value)
 
SValuePtr svalueBoolean (bool b)
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RiscOperators
 RiscOperators (const SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 
 RiscOperators (const StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 

Additional Inherited Members

- Protected Attributes inherited from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators
bool omit_cur_insn
 
DefinersMode computingDefiners_
 
WritersMode computingMemoryWriters_
 
WritersMode computingRegisterWriters_
 
uint64_t trimThreshold_
 
bool reinterpretMemoryReads_
 
bool reinterpretRegisterReads_
 
size_t nTrimmed_ = 0
 

Member Typedef Documentation

Base type.

Definition at line 45 of file LlvmSemantics.h.

Shared-ownership pointer.

Definition at line 48 of file LlvmSemantics.h.

Member Function Documentation

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::instanceFromRegisters ( const RegisterDictionaryPtr ,
const SmtSolverPtr solver = SmtSolverPtr() 
)
static

Instantiates a new RiscOperators object and configures it to use semantic values and states that are defaults for LlvmSemantics.

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::instanceFromProtoval ( const BaseSemantics::SValuePtr protoval,
const SmtSolverPtr solver = SmtSolverPtr() 
)
static

Instantiates a new RiscOperators object with specified prototypical values.

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::instanceFromState ( const BaseSemantics::StatePtr ,
const SmtSolverPtr solver = SmtSolverPtr() 
)
static

Instantiates a new RiscOperators object with specified state.

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::create ( const BaseSemantics::SValuePtr protoval,
const SmtSolverPtr solver = SmtSolverPtr() 
) const
overridevirtual

Virtual allocating constructor.

The protoval is a prototypical semantic value that is used as a factory to create additional values as necessary via its virtual constructors. The state upon which the RISC operations operate must be set by modifying the currentState property. An optional SMT solver may be specified (see solver).

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators.

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::create ( const BaseSemantics::StatePtr state,
const SmtSolverPtr solver = SmtSolverPtr() 
) const
overridevirtual

Virtual allocating constructor.

The supplied state is that upon which the RISC operations operate and is also used to define the prototypical semantic value. Other states can be supplied by setting currentState. The prototypical semantic value is used as a factory to create additional values as necessary via its virtual constructors. An optional SMT solver may be specified (see solver).

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators.

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::promote ( const BaseSemantics::RiscOperatorsPtr )
static

Run-time promotion of a base RiscOperators pointer to Llvm operators.

This is a checked-converstion–it will fail if x does not point to a LlvmSemantics::RiscOperators object.

int Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::llvmVersion ( ) const
inline

Property: LLVM version.

Different versions of LLVM have different assembly syntaxes which are not backward compatible, and this property which dialect is emitted. This property is set to a*x^2 + b*x + c where a, b, and c are the three-part LLVM version number "a.b.c" and x is 1000. The special value zero is reserved to mean that the version number is unknown.

Definition at line 112 of file LlvmSemantics.h.

void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::llvmVersion ( int  v)
inline

Property: LLVM version.

Different versions of LLVM have different assembly syntaxes which are not backward compatible, and this property which dialect is emitted. This property is set to a*x^2 + b*x + c where a, b, and c are the three-part LLVM version number "a.b.c" and x is 1000. The special value zero is reserved to mean that the version number is unknown.

Definition at line 113 of file LlvmSemantics.h.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::readMemory ( RegisterDescriptor  segreg,
const BaseSemantics::SValuePtr addr,
const BaseSemantics::SValuePtr dflt,
const BaseSemantics::SValuePtr cond 
)
overridevirtual

Reads a value from memory.

The implementation (in subclasses) will typically delegate much of the work to the current state's readMemory method.

A MemoryState will implement storage for memory locations and might impose certain restrictions, such as "all memory values must be eight bits". However, the readMemory should not have these constraints so that it can be called from a variety of Dispatcher subclass (e.g., the DispatcherX86 class assumes that readMemory is capable of reading 32-bit values from little-endian memory). The designers of the MemoryState, State, and RiscOperators should collaborate to decide which layer (RiscOperators, State, or MemoryState) is reponsible for combining individual memory locations into larger values. A RiscOperators object is passed along the chain of delegations for this purpose. The RiscOperators might also contain other data that's important during the process, such as an SMT solver.

The segreg argument is an optional segment register. Most architectures have a flat virtual address space and will pass a default-constructed register descriptor whose is_valid() method returns false.

The cond argument is a Boolean value that indicates whether this is a true read operation. If cond can be proven to be false then the read is a no-op and returns an arbitrary value.

The dflt argument determines the size of the value to be read. This argument is also passed along to the lower layers so that they can, if they desire, use it to initialize memory that has never been read or written before.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::writeMemory ( RegisterDescriptor  segreg,
const BaseSemantics::SValuePtr addr,
const BaseSemantics::SValuePtr data,
const BaseSemantics::SValuePtr cond 
)
overridevirtual

Writes a value to memory.

The implementation (in subclasses) will typically delegate much of the work to the current state's writeMemory method.

The segreg argument is an optional segment register. Most architectures have a flat virtual address space and will pass a default-constructed register descriptor whose is_valid() method returns false.

The cond argument is a Boolean value that indicates whether this is a true write operation. If cond can be proved to be false then writeMemory is a no-op.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::RiscOperators.

int Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::indent ( int  nlevels = 1)
inline

Increase indentation by nlevels levels.

Indentation is decreased if nlevels is negative. Returns the new indentation level. It is permissible for the indentation to become negative, but prefix() always returns a non-negative amount of space.

Definition at line 131 of file LlvmSemantics.h.

std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::prefix ( ) const

Return indentation string.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::reset ( )
virtual

Reset to initial state.

virtual const RegisterDescriptors& Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::get_important_registers ( )
virtual

Return the list of registers that needs to be emitted to LLVM.

Regardless of what registers are written (e.g., AX), return a list of registers that we're keeping track of in global variables (e.g., EAX).

virtual RegisterDescriptors Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::get_stored_registers ( )
virtual

Return the list of important registers that are stored.

This is a subset of the value returned by get_important_registers().

virtual RegisterDescriptors Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::get_modified_registers ( )
virtual

Return the list of important registers that have been modified since the last call to make_current().

virtual RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::get_insn_pointer_register ( )
virtual

Return the descriptor for the instruction pointer register.

virtual SValuePtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::get_instruction_pointer ( )
virtual

Return the value of the instruction pointer.

virtual const TreeNodes& Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::get_memory_writes ( )
inlinevirtual

Return the list of memory writes that have occured since the last call to make_current().

Each item in the list is an OP_WRITE symbolic expression, and the list is in the order the write occurred (oldest to most recent). The memory states are each unique and not used for anything in particular.

Definition at line 179 of file LlvmSemantics.h.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::make_current ( )
virtual

Mark the current state as having been emitted.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::add_rewrite ( const ExpressionPtr from,
const LeafPtr to 
)
virtual

Register a rewrite.

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::add_variable ( const LeafPtr )
virtual

Register an LLVM variable.

Returns the LLVM variable name including its sigil. If the variable doesn't exist yet then it's added to the list of known variables.

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::get_variable ( const LeafPtr )
virtual

Returns the LLVM name for a variable, including the sigil.

If the specified ROSE variable has no corresponding LLVM definition, then the empty string is returned.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_register_declarations ( std::ostream &  ,
const RegisterDescriptors &   
)
virtual

Output LLVM global register declarations for the specified registers.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_register_definitions ( std::ostream &  ,
const RegisterDescriptors &   
)
virtual

Output LLVM global register definitions for the specified registers.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_prerequisites ( std::ostream &  ,
const RegisterDescriptors &  ,
const RegisterDictionaryPtr  
)
virtual

Output LLVM global variable reads that are needed to define the specified registers and pending memory writes.

Since registers are stored in global variables and we routinely emit more than one register definition at a time, we need to first make sure that any global prerequisites for the definitions are saved in temporaries. This is to handle cases like the following, where the values of eax and ebx are swapped using edx as a temporary:

mov edx, eax
mov eax, ebx
mov ebx, edx

If we emit all the register definitions at the end of these three x86 instructions, we should get LLVM output similar to the following:

%1 = @eax
%2 = @ebx
@eax = %2
@ebx = %1
@edx = %1

The dictionary is used to convert register names (that appear in symbolic variable comments, like "eax_0") to register descriptors. If a register reference (like "eax_0") corresponds to a register that we're not interested in, then don't bother emitting a temporary variable for the register.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_next_eip ( std::ostream &  ,
SgAsmInstruction latest_insn 
)
virtual

Output an LLVM branch instruction.

The latest_insn is the most recent instruction that was transcoded, usually the last instruction of a basic block.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_memory_writes ( std::ostream &  )
virtual

Output changed memory state.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_changed_state ( std::ostream &  )
virtual

Output LLVM to bring the LLVM state up to date with respect to the ROSE state.

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::llvm_integer_type ( size_t  nbits)
virtual

Obtain the LLVM type name for an integer.

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::llvm_term ( const ExpressionPtr )
virtual

Convert a ROSE variable or integer to an LLVM term.

A term must be a constant or a variable reference (rvalue).

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::llvm_lvalue ( const LeafPtr )
virtual

Convert a ROSE variable to an LLVM lvalue.

The variable must not have been used as an lvalue previously since LLVM uses single static assignment (SSA) format.

virtual LeafPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::next_temporary ( size_t  nbits)
virtual

Create a temporary variable.

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::next_label ( )
virtual

Obtain the name for an LLVM label, excluding the "%" sigil.

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::addr_label ( rose_addr_t  )
virtual

Obtain a label for a virtual address.

virtual std::string Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::function_label ( SgAsmFunction )
virtual

Obtain a label for a function.

virtual LeafPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_expression ( std::ostream &  ,
const SValuePtr  
)
virtual

Emit LLVM statements for an expression.

This method transcodes an expression to LLVM and returns an LLVM terminal node (a constant or variable). The terminal node is not part of the output. For instance, an expression like:

(add[32] v1[32] v2[32] (negate[32] v3[32]))

Would produce the following LLVM

%4 = add i32 %1, i32 %2
%5 = sub i32 0, i32 %3
%6 = add i32 %4, i32 %5

and returns the symbolic variable "v6".

virtual LeafPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_expression ( std::ostream &  ,
const ExpressionPtr  
)
virtual

Emit LLVM statements for an expression.

This method transcodes an expression to LLVM and returns an LLVM terminal node (a constant or variable). The terminal node is not part of the output. For instance, an expression like:

(add[32] v1[32] v2[32] (negate[32] v3[32]))

Would produce the following LLVM

%4 = add i32 %1, i32 %2
%5 = sub i32 0, i32 %3
%6 = add i32 %4, i32 %5

and returns the symbolic variable "v6".

virtual LeafPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_expression ( std::ostream &  ,
const LeafPtr  
)
virtual

Emit LLVM statements for an expression.

This method transcodes an expression to LLVM and returns an LLVM terminal node (a constant or variable). The terminal node is not part of the output. For instance, an expression like:

(add[32] v1[32] v2[32] (negate[32] v3[32]))

Would produce the following LLVM

%4 = add i32 %1, i32 %2
%5 = sub i32 0, i32 %3
%6 = add i32 %4, i32 %5

and returns the symbolic variable "v6".

virtual LeafPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_assignment ( std::ostream &  ,
const ExpressionPtr rhs 
)
protectedvirtual

Emit an assignment and add a rewrite rule.

The left hand side is a new LLVM temporary variable (which is returned). If rhs is an LLVM unamed local variable then rhs is returned. Otherwise, a rewrite rule is added so that future appearances of the right hand side will be replaced by the left hand side in calls to emit_expression().

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_zero_extend ( std::ostream &  ,
const ExpressionPtr value,
size_t  nbits 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_sign_extend ( std::ostream &  ,
const ExpressionPtr value,
size_t  nbits 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_truncate ( std::ostream &  ,
const ExpressionPtr value,
size_t  nbits 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_unsigned_resize ( std::ostream &  ,
const ExpressionPtr value,
size_t  nbits 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_binary ( std::ostream &  ,
const std::string &  llvm_op,
const ExpressionPtr ,
const ExpressionPtr  
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_signed_binary ( std::ostream &  ,
const std::string &  llvm_op,
const ExpressionPtr ,
const ExpressionPtr  
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_unsigned_binary ( std::ostream &  ,
const std::string &  llvm_op,
const ExpressionPtr ,
const ExpressionPtr  
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_logical_right_shift ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr amount 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_logical_right_shift_ones ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr amount 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_arithmetic_right_shift ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr amount 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_left_shift ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr amount 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_left_shift_ones ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr amount 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_lssb ( std::ostream &  ,
const ExpressionPtr  
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_mssb ( std::ostream &  ,
const ExpressionPtr  
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_extract ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr from,
size_t  result_nbits 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_invert ( std::ostream &  ,
const ExpressionPtr value 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_left_associative ( std::ostream &  ,
const std::string &  llvm_op,
const TreeNodes &  operands 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_concat ( std::ostream &  ,
TreeNodes  operands 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_signed_divide ( std::ostream &  ,
const ExpressionPtr numerator,
const ExpressionPtr denominator 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_unsigned_divide ( std::ostream &  ,
const ExpressionPtr numerator,
const ExpressionPtr denominator 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_signed_modulo ( std::ostream &  ,
const ExpressionPtr numerator,
const ExpressionPtr denominator 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_unsigned_modulo ( std::ostream &  ,
const ExpressionPtr numerator,
const ExpressionPtr denominator 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_signed_multiply ( std::ostream &  ,
const TreeNodes &  operands 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_unsigned_multiply ( std::ostream &  ,
const TreeNodes &  operands 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_rotate_left ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr amount 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_rotate_right ( std::ostream &  ,
const ExpressionPtr value,
const ExpressionPtr amount 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_compare ( std::ostream &  ,
const std::string &  llvm_op,
const ExpressionPtr ,
const ExpressionPtr  
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_ite ( std::ostream &  ,
const ExpressionPtr cond,
const ExpressionPtr ,
const ExpressionPtr  
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_memory_read ( std::ostream &  ,
const ExpressionPtr address,
size_t  nbits 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual ExpressionPtr Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_global_read ( std::ostream &  ,
const std::string &  varname,
size_t  nbits 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.

virtual void Rose::BinaryAnalysis::InstructionSemantics::LlvmSemantics::RiscOperators::emit_memory_write ( std::ostream &  ,
const ExpressionPtr address,
const ExpressionPtr value 
)
protectedvirtual

Emit an operation as LLVM instructions.

These "emit" methods take operands that are symbolic expressions and output LLVM instructions that implement the expression. The return value is either an LLVM term (variable or integer) or an expression. Expressions are only returned in cases where the operation is a no-op, such as for the symbolic expression "(add (negate v3))" where the "add" is a no-op that simply returns its only argument. Because these "emit" methods might return an expression, it is customary to call emit_expression() on their return value.


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