ROSE 0.11.145.192
BaseVariable.h
1#ifndef ROSE_BinaryAnalysis_Variables_BaseVariable_H
2#define ROSE_BinaryAnalysis_Variables_BaseVariable_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5
6#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
7#include <Rose/BinaryAnalysis/Variables/InstructionAccess.h>
8
9#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
10#include <boost/serialization/access.hpp>
11#endif
12
13namespace Rose {
14namespace BinaryAnalysis {
15namespace Variables {
16
19private:
20 rose_addr_t maxSizeBytes_ = 0; // maximum possible size of this variable in bytes
21 std::vector<InstructionAccess> insns_; // instructions accessing the variable
22 std::string name_; // optional variable name
23
24#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
25private:
26 friend class boost::serialization::access;
27
28 template<class S>
29 void serialize(S &s, const unsigned /*version*/) {
30 s & BOOST_SERIALIZATION_NVP(maxSizeBytes_);
31 s & BOOST_SERIALIZATION_NVP(insns_);
32 s & BOOST_SERIALIZATION_NVP(name_);
33 }
34#endif
35
36protected:
41
43 BaseVariable(size_t maxSizeBytes, const std::vector<InstructionAccess> &definingInstructions, const std::string &name);
44
45public:
48
49public:
56 rose_addr_t maxSizeBytes() const;
57 void maxSizeBytes(rose_addr_t size);
66 const std::vector<InstructionAccess>& instructionsAccessing() const;
67 void instructionsAccessing(const std::vector<InstructionAccess>&);
74
79
86 const std::string& name() const;
87 void name(const std::string &s);
92};
93
94} // namespace
95} // namespace
96} // namespace
97
98#endif
99#endif
Base class describing a source-level variable.
void maxSizeBytes(rose_addr_t size)
Property: Maximum variable size in bytes.
InstructionSemantics::BaseSemantics::InputOutputPropertySet ioProperties() const
Property: I/O properties.
BaseVariable(size_t maxSizeBytes, const std::vector< InstructionAccess > &definingInstructions, const std::string &name)
Construct a variable with a given maximum size.
void name(const std::string &s)
Property: Optional variable name.
rose_addr_t maxSizeBytes() const
Property: Maximum variable size in bytes.
const std::vector< InstructionAccess > & instructionsAccessing() const
Property: Defining instructions.
AccessFlags accessFlags() const
Read/write status.
void instructionsAccessing(const std::vector< InstructionAccess > &)
Property: Defining instructions.
const std::string & name() const
Property: Optional variable name.
void insertAccess(Address insnAddr, AccessFlags)
Insert information about how an instruction accesses this variable.
std::uint64_t Address
Address.
Definition Address.h:11
The ROSE library.