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>
16namespace BinaryAnalysis {
17namespace InstructionSemantics {
18namespace DataFlowSemantics {
55typedef 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);
137 class TemporarilyDeactivate {
140 bool wasActive_, canceled_;
143 : ops_(ops), id_(id), wasActive_(ops->
is_active(id)), canceled_(false) {
144 ops->set_active(
id,
false);
146 ~TemporarilyDeactivate() {
158 void insertDataFlowEdge(
const AbstractLocation &source,
const AbstractLocation &target,
DataFlowEdge::EdgeType);
void clearGraph()
Clear dataflow graph.
virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a_) override
Writes a value to a register.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
Reads a value from a register.
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) override
Obtain a register value without side effects.
RiscOperatorsPtr Ptr
Shared-ownership pointer.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to operators for this domain.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &dflt_) override
Read memory without side effects.
static RiscOperatorsPtr instance(const BaseSemantics::RiscOperatorsPtr &childOps)
Static allocating constructor.
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) override
Writes a value to memory.
virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr_, const BaseSemantics::SValuePtr &dflt_, const BaseSemantics::SValuePtr &cond) override
Reads a value from memory.
Defines RISC operators for the MultiSemantics domain.
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.
Describes (part of) a physical CPU register.
Graph containing user-defined vertices and edges.
void clear()
Remove all vertices and edges.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
std::shared_ptr< SmtSolver > SmtSolverPtr
Reference counting pointer.
const size_t INVALID_INDEX
Invalid array index.
Information per dataflow edge.
EdgeType edgeType
Whether edge resets or augments previous flows to target.
size_t sequence
Edge sequence number unique and constant within graph.
EdgeType
Type of dataflow edge.
@ CLOBBER
This edge clobbers previous flows into the target.
@ AUGMENT
This edge augments previous flows into the target.