1 #ifndef Rose_BinaryAnalysis_DataFlowSemantics_H
2 #define Rose_BinaryAnalysis_DataFlowSemantics_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include "AbstractLocation.h"
7 #include "BaseSemantics2.h"
8 #include "MultiSemantics2.h"
9 #include "NullSemantics2.h"
11 #include <boost/foreach.hpp>
12 #include <Sawyer/Assert.h>
13 #include <Sawyer/Graph.h>
17 namespace InstructionSemantics2 {
18 namespace DataFlowSemantics {
55 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
69 size_t innerDomainId_;
96 ASSERT_not_reachable(
"should not be called by user code");
104 ASSERT_not_reachable(
"should not be called by user code");
115 RiscOperatorsPtr retval = boost::dynamic_pointer_cast<
RiscOperators>(x);
116 ASSERT_not_null(retval);
127 const DataFlowGraph&
getGraph()
const {
return dflow_; }
131 class TemporarilyDeactivate {
134 bool wasActive_, canceled_;
137 : ops_(ops), id_(id), wasActive_(ops->
is_active(id)), canceled_(false) {
140 ~TemporarilyDeactivate() {
152 void insertDataFlowEdge(
const AbstractLocation &source,
const AbstractLocation &target,
DataFlowEdge::EdgeType);
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &dflt_) ROSE_OVERRIDE
Read memory without side effects.
This edge augments previous flows into the target.
static SValuePtr instance()
Construct a prototypical value.
virtual bool is_active(size_t idx) const
Returns true if a subdomain is active.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
static RiscOperatorsPtr instance(const BaseSemantics::RiscOperatorsPtr &childOps)
Static allocating constructor.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
Main namespace for the ROSE library.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Reads a value from a register.
This edge clobbers previous flows into the target.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to operators for this domain.
virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &dflt_, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Reads a value from memory.
Defines RISC operators for the MultiSemantics domain.
size_t sequence
Edge sequence number unique and constant within graph.
void clearGraph()
Clear dataflow graph.
virtual void set_active(size_t idx, bool status)
Makes a subdomain active or inactive.
EdgeType edgeType
Whether edge resets or augments previous flows to target.
void clear()
Remove all vertices and edges.
virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Writes a value to a register.
Information per dataflow edge.
Defines registers available for a particular architecture.
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
EdgeType
Type of dataflow edge.
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Obtain a register value without side effects.
const size_t INVALID_INDEX(-1)
Invalid array index.
std::shared_ptr< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
const DataFlowGraph & getGraph() const
Return the dataflow graph.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &data_, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Writes a value to memory.