ROSE 0.11.145.147
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
10
11namespace Rose {
12namespace BinaryAnalysis {
13namespace Partitioner2 {
14
16// Reference
18
25class Reference {
26 FunctionPtr function_;
27 BasicBlockPtr bblock_;
28 SgAsmInstruction *insn_;
30public:
41
42 ~Reference();
43
49 explicit Reference(const FunctionPtr&);
50
51 explicit Reference(const FunctionPtr&, const BasicBlockPtr&,
53
55
57
58 explicit Reference(rose_addr_t address);
59
68
72 bool isEmpty() const;
73
77 bool hasFunction() const;
78
81
85 bool hasBasicBlock() const;
86
89
93 bool hasInstruction() const;
94
97
102 bool hasExplicitAddress() const;
103
108 rose_addr_t address() const;
109
113 bool operator==(const Reference &other) const;
114
121 bool operator<(const Reference &other) const;
122};
123
124} // namespace
125} // namespace
126} // namespace
127
128#endif
129#endif
Reference to a function, basic block, instruction, or address.
Definition Reference.h:25
Reference(SgAsmInstruction *, const Sawyer::Optional< rose_addr_t > &=Sawyer::Nothing())
Constructor.
bool hasBasicBlock() const
Predicate for having a basic block.
bool hasInstruction() const
Predicate for having an instruction.
@ EMPTY
Reference points to nothing and has no address.
Definition Reference.h:33
@ BASIC_BLOCK
Reference points to a basic block but not an instruction or a stored address.
Definition Reference.h:36
@ ADDRESS
Reference points to nothing but has an address.
Definition Reference.h:34
@ FUNCTION
Reference points to a function but not a basic block or instruction, and has no stored address.
Definition Reference.h:38
@ INSTRUCTION
Reference points to an instruction but no stored address.
Definition Reference.h:35
Reference(const FunctionPtr &, const BasicBlockPtr &, SgAsmInstruction *=nullptr, const Sawyer::Optional< rose_addr_t > &=Sawyer::Nothing())
Constructor.
bool hasExplicitAddress() const
Predicate for having a stored address.
bool hasFunction() const
Predicate for having a function.
bool isEmpty() const
Predicate for emptiness.
BasicBlockPtr basicBlock() const
Optional basic block pointer.
FunctionPtr function() const
Optional function pointer.
Reference(const FunctionPtr &)
Constructor.
Granularity granularity() const
Reference granularity.
bool operator<(const Reference &other) const
Compare two references.
bool operator==(const Reference &other) const
Whether two references are equal.
Reference(rose_addr_t address)
Constructor.
SgAsmInstruction * instruction() const
Optional instruction pointer.
Reference(const BasicBlockPtr &, SgAsmInstruction *=nullptr, const Sawyer::Optional< rose_addr_t > &=Sawyer::Nothing())
Constructor.
Represents no value.
Definition Optional.h:36
Holds a value or nothing.
Definition Optional.h:56
Base class for machine instructions.
The ROSE library.