1 #ifndef ROSE_BinaryAnalysis_Partitioner2_DataFlow_H
2 #define ROSE_BinaryAnalysis_Partitioner2_DataFlow_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
6 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
8 #include <Rose/BinaryAnalysis/DataFlow.h>
9 #include <Rose/BinaryAnalysis/Variables.h>
10 #include <Sawyer/Graph.h>
16 namespace BinaryAnalysis {
17 namespace Partitioner2 {
94 void print(std::ostream&)
const;
133 virtual bool operator()(
const ControlFlowGraph&,
const ControlFlowGraph::ConstEdgeIterator&,
size_t depth) = 0;
139 bool operator()(
const ControlFlowGraph&,
const ControlFlowGraph::ConstEdgeIterator&,
size_t )
override {
172 template<
class DfCfg>
179 ASSERT_require(retval == dfCfg.
vertices().end());
201 bool ignoringSemanticFailures_;
Rose::BinaryAnalysis::DataFlow::SemanticsMerge MergeFunction
Data-flow merge function.
Type type() const
Type of the vertex.
DfCfg buildDfCfg(const PartitionerConstPtr &, const ControlFlowGraph &, const ControlFlowGraph::ConstVertexIterator &startVertex, InterproceduralPredicate &predicate=NOT_INTERPROCEDURAL)
build a cfg useful for data-flow analysis.
Predicate that always returns false, preventing interprocedural analysis.
FunctionPtr bestSummaryFunction(const FunctionSet &functions)
Choose best function for data-flow summary vertex.
Graph containing user-defined vertices and edges.
Sawyer::Container::GraphTraits< DfCfg >::VertexIterator findReturnVertex(DfCfg &dfCfg)
Find the return vertex.
Basic merge operation for instruction semantics.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
Data-Flow transfer functor.
Sawyer::Optional< rose_addr_t > address() const
Virtual address of vertex.
boost::iterator_range< VertexIterator > vertices()
Iterators for all vertices.
Main namespace for the ROSE library.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
const FunctionPtr & callee() const
Function represented by faked call.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
CFG vertex for data-flow analysis.
Vertex represents a basic block.
Vertex represents returning to the caller.
Variables::StackVariables findLocalVariables(const FunctionPtr &function, const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &ops, const InstructionSemantics::BaseSemantics::SValuePtr &initialStackPointer)
Returns the list of all known local variables.
InstructionSemantics::BaseSemantics::StatePtr initialState() const
Construct an initial state.
Container classes that store user-defined values.
TransferFunction(const InstructionSemantics::BaseSemantics::DispatcherPtr &)
Construct from a CPU.
Describes (part of) a physical CPU register.
Sawyer::Container::Graph< DfCfgVertex > DfCfg
Control flow graph used by data-flow analysis.
Predicate that decides when to use inter-procedural data-flow.
size_t inliningId() const
Inlining invocation number.
InstructionSemantics::BaseSemantics::DispatcherPtr cpu() const
Property: Virtual CPU.
Represents a whole called function.
std::vector< SgAsmInstruction * > vertexUnpacker(const DfCfgVertex &)
Unpacks a vertex into a list of instructions.
std::vector< AbstractLocation > findGlobalVariables(const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &ops, size_t wordNBytes)
Returns a list of global variables.
void print(std::ostream &) const
Print a short description of this vertex.
Variables::StackVariables findFunctionArguments(const FunctionPtr &function, const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &ops, const InstructionSemantics::BaseSemantics::SValuePtr &initialStackPointer)
Returns the list of all known function arguments.
DfCfgVertex(const BasicBlockPtr &, const FunctionPtr &parentFunction, size_t inliningId)
Construct a basic block vertex.
G::VertexIterator VertexIterator
Const or non-const vertex iterator.
FunctionPtr parentFunction() const
Function owning this vertex.
void dumpDfCfg(std::ostream &, const DfCfg &)
Emit a data-flow CFG as a GraphViz file.
Indeterminate basic block where no information is available.
Variables::StackVariables findStackVariables(const FunctionPtr &function, const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &ops, const InstructionSemantics::BaseSemantics::SValuePtr &initialStackPointer)
Returns the list of all known stack variables.
const BasicBlockPtr & bblock() const
Basic block.
bool ignoringSemanticFailures() const
Property: Whether to ignore instructions with unknown semantics.
std::string toString() const
Single-line description of this vertex.
CallingConvention::DefinitionPtr defaultCallingConvention() const
Property: Default calling convention.