1 #ifndef ROSE_BinaryAnalysis_BinaryNoOperation_H
2 #define ROSE_BinaryAnalysis_BinaryNoOperation_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <BaseSemantics2.h>
7 #include <Sawyer/Message.h>
26 size_t ignorePoppedMemory_;
65 bool ignoreTerminalBranches_;
76 : ignoreTerminalBranches_(true) {}
80 : cpu_(cpu), normalizer_(
StateNormalizer::instance()), ignoreTerminalBranches_(true) {}
126 bool isNoop(
const std::vector<SgAsmInstruction*>&)
const;
144 static std::vector<bool>
toVector(
const IndexIntervals&,
size_t size=0);
Base class for normalizing a state.
virtual InstructionSemantics2::BaseSemantics::StatePtr initialState(const InstructionSemantics2::BaseSemantics::DispatcherPtr &, SgAsmInstruction *firstInsn)
Constructs an initial state.
size_t ignorePoppedMemory() const
Property: ignore recently popped memory.
std::vector< IndexInterval > IndexIntervals
A vector of instruction indices.
Base class for machine instructions.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
bool isNoop(SgAsmInstruction *) const
Determines if an instruction is a no-op.
Main namespace for the ROSE library.
static void initDiagnostics()
Initializes and registers disassembler diagnostic streams.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
void initialStackPointer(const Sawyer::Optional< rose_addr_t > &v)
Property: initial concrete value for stack pointer.
virtual std::string toString(const InstructionSemantics2::BaseSemantics::DispatcherPtr &, const InstructionSemantics2::BaseSemantics::StatePtr &)
Takes a state and returns a normalized string.
void ignoreTerminalBranches(bool b)
Property: Whether terminal branches can be no-ops.
void stateNormalizer(const StateNormalizer::Ptr &f)
Property: state normalizer.
static std::vector< bool > toVector(const IndexIntervals &, size_t size=0)
Return a boolean vector.
IndexIntervals findNoopSubsequences(const std::vector< SgAsmInstruction * > &) const
Finds all sequences of instructions that are equivalent to no-operation.
NoOperation()
Default constructor.
Base class for reference counted objects.
static IndexIntervals largestEarliestNonOverlapping(const IndexIntervals &)
Select certain no-op sequences.
static Sawyer::Message::Facility mlog
Diagnostic streams.
const Sawyer::Optional< rose_addr_t > initialStackPointer() const
Property: initial concrete value for stack pointer.
Sawyer::Container::Interval< size_t > IndexInterval
An interval of instruction indices.
void ignorePoppedMemory(size_t nbytes)
Property: ignore recently popped memory.
StateNormalizer::Ptr stateNormalizer() const
Property: state normalizer.
static Ptr instance()
Allocating constructor.
NoOperation(const InstructionSemantics2::BaseSemantics::DispatcherPtr &cpu)
Construct a new analysis with specified virtual CPU.
Analysis that looks for no-op equivalents.
Virtual base class for instruction disassemblers.
bool ignoreTerminalBranches() const
Property: Whether terminal branches can be no-ops.
Sawyer::SharedPointer< StateNormalizer > Ptr
Shared ownership pointer to a StateNormalizer.