ROSE  0.11.145.0
Reference.h
1 #ifndef ROSE_BinaryAnalysis_Partitioner2_Reference_H
2 #define ROSE_BinaryAnalysis_Partitioner2_Reference_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
6 
7 #include <set>
8 
9 namespace Rose {
10 namespace BinaryAnalysis {
11 namespace Partitioner2 {
12 
14 // Reference
16 
23 class Reference {
24  FunctionPtr function_;
25  BasicBlockPtr bblock_;
26  SgAsmInstruction *insn_;
28 public:
30  enum Granularity {
38  };
39 
40  ~Reference();
41 
47  explicit Reference(const FunctionPtr&);
48 
49  explicit Reference(const FunctionPtr&, const BasicBlockPtr&,
51 
53 
55 
56  explicit Reference(rose_addr_t address);
57 
58  Reference();
65  Granularity granularity() const;
66 
70  bool isEmpty() const;
71 
75  bool hasFunction() const;
76 
78  FunctionPtr function() const;
79 
83  bool hasBasicBlock() const;
84 
86  BasicBlockPtr basicBlock() const;
87 
91  bool hasInstruction() const;
92 
95 
100  bool hasExplicitAddress() const;
101 
106  rose_addr_t address() const;
107 
111  bool operator==(const Reference &other) const;
112 
119  bool operator<(const Reference &other) const;
120 };
121 
122 } // namespace
123 } // namespace
124 } // namespace
125 
126 #endif
127 #endif
bool hasBasicBlock() const
Predicate for having a basic block.
bool isEmpty() const
Predicate for emptiness.
SgAsmInstruction * instruction() const
Optional instruction pointer.
Reference points to a basic block but not an instruction or a stored address.
Definition: Reference.h:34
Reference to a function, basic block, instruction, or address.
Definition: Reference.h:23
Base class for machine instructions.
Reference points to nothing and has no address.
Definition: Reference.h:31
bool operator==(const Reference &other) const
Whether two references are equal.
Main namespace for the ROSE library.
Reference points to nothing but has an address.
Definition: Reference.h:32
rose_addr_t address() const
Address.
bool hasInstruction() const
Predicate for having an instruction.
Reference points to an instruction but no stored address.
Definition: Reference.h:33
BasicBlockPtr basicBlock() const
Optional basic block pointer.
bool hasExplicitAddress() const
Predicate for having a stored address.
bool operator<(const Reference &other) const
Compare two references.
Granularity granularity() const
Reference granularity.
Reference points to a function but not a basic block or instruction, and has no stored address...
Definition: Reference.h:36
bool hasFunction() const
Predicate for having a function.
Represents no value.
Definition: Optional.h:32