ROSE  0.9.9.109
BinaryReachability.h
1 #ifndef ROSE_BinaryAnalysis_Reachability_H
2 #define ROSE_BinaryAnalysis_Reachability_H
3 
4 #include <Partitioner2/ControlFlowGraph.h>
5 #include <set>
6 #include <vector>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 
15 class Reachability {
16 public:
18  enum Reason {
20  ENTRY_POINT = 0x00000001,
21  EXPORTED_FUNCTION = 0x00000002,
22  SIGNAL_HANDLER = 0x00000004,
23  PREDEFINED = 0x000000ff,
24  USER_DEFINED = 0xffffff00,
25  USER_DEFINED_0 = 0x00000100
26  };
27 
28 private:
29  Partitioner2::ControlFlowGraph cfg_; // CFG upon which we're operating
30  std::vector<unsigned> intrinsicReachability_; // intrinsic reachability of each vertex in the CFG
31  std::vector<unsigned> reachability_; // computed reachability of each vertex in the CFG
32 
33 public:
40  const Partitioner2::ControlFlowGraph& cfg() const /*final*/ { return cfg_; }
47  void clear();
48 
52  void clearReachability();
53 
58  unsigned isIntrinsicallyReachable(size_t vertexId) const;
59 
66  void intrinsicallyReachable(size_t vertexId, unsigned how, bool doPropagate = true);
67 
72  unsigned isReachable(size_t vertexId) const;
73 
77  const std::vector<unsigned>& reachability() const;
78 
85 
90  void propagate();
91 };
92 
93 } // namespace
94 } // namespace
95 
96 #endif
ROSE-defined reachability reasons.
const Partitioner2::ControlFlowGraph & cfg() const
Property: Control flow graph.
void clear()
Clear previous results.
Main namespace for the ROSE library.
Reason
Predefined bit flags for why something is reachable.
void clearReachability()
Clear all reachability.
void propagate()
Propagate intrinsic reachability through the graph.
void intrinsicallyReachable(size_t vertexId, unsigned how, bool doPropagate=true)
Change intrinsic reachability.
const std::vector< unsigned > & reachability() const
Computed reachability for all vertices.
Analysis that computes reachability of CFG vertices.
void markSpecialFunctions(const Partitioner2::Partitioner &)
Mark special vertices for containers.
unsigned isIntrinsicallyReachable(size_t vertexId) const
Query intrinsic reachability.
unsigned isReachable(size_t vertexId) const
Query computed reachability.
Partitions instructions into basic blocks and functions.
Definition: Partitioner.h:289