1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics_DataFlowSemantics_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics_DataFlowSemantics_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <Rose/BinaryAnalysis/AbstractLocation.h>
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
8 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
9 #include <Rose/BinaryAnalysis/InstructionSemantics/MultiSemantics.h>
10 #include <Rose/BinaryAnalysis/InstructionSemantics/NullSemantics.h>
12 #include <Sawyer/Assert.h>
13 #include <Sawyer/Graph.h>
16 namespace BinaryAnalysis {
17 namespace InstructionSemantics {
18 namespace DataFlowSemantics {
55 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
71 using Ptr = RiscOperatorsPtr;
75 size_t innerDomainId_;
102 ASSERT_not_reachable(
"should not be called by user code");
110 ASSERT_not_reachable(
"should not be called by user code");
121 RiscOperatorsPtr retval = boost::dynamic_pointer_cast<
RiscOperators>(x);
122 ASSERT_not_null(retval);
133 const DataFlowGraph&
getGraph()
const {
return dflow_; }
137 class TemporarilyDeactivate {
140 bool wasActive_, canceled_;
143 : ops_(ops), id_(id), wasActive_(ops->
is_active(id)), canceled_(false) {
146 ~TemporarilyDeactivate() {
158 void insertDataFlowEdge(
const AbstractLocation &source,
const AbstractLocation &target,
DataFlowEdge::EdgeType);
Information per dataflow edge.
const DataFlowGraph & getGraph() const
Return the dataflow graph.
Defines RISC operators for the MultiSemantics domain.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to operators for this domain.
static RiscOperatorsPtr instance(const BaseSemantics::RiscOperatorsPtr &childOps)
Static allocating constructor.
virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a_) override
Writes a value to a register.
virtual void set_active(size_t idx, bool status)
Makes a subdomain active or inactive.
virtual bool is_active(size_t idx) const
Returns true if a subdomain is active.
void clearGraph()
Clear dataflow graph.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &dflt_) override
Read memory without side effects.
Main namespace for the ROSE library.
RiscOperatorsPtr Ptr
Shared-ownership pointer.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
EdgeType
Type of dataflow edge.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &data_, const BaseSemantics::SValuePtr &cond) override
Writes a value to memory.
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
Obtain a register value without side effects.
EdgeType edgeType
Whether edge resets or augments previous flows to target.
virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &dflt_, const BaseSemantics::SValuePtr &cond) override
Reads a value from memory.
void clear()
Remove all vertices and edges.
size_t sequence
Edge sequence number unique and constant within graph.
std::shared_ptr< SmtSolver > SmtSolverPtr
Reference counting pointer.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
Reads a value from a register.
This edge clobbers previous flows into the target.
This edge augments previous flows into the target.
const size_t INVALID_INDEX(static_cast< size_t >(-1))
Invalid array index.