1#ifndef ROSE_BinaryAnalysis_ConcreteLocation_H
2#define ROSE_BinaryAnalysis_ConcreteLocation_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/BasicTypes.h>
7#include <Rose/BinaryAnalysis/RegisterDescriptor.h>
8#include <Rose/Location.h>
10#include <boost/serialization/access.hpp>
12#include <Sawyer/Optional.h>
16namespace BinaryAnalysis {
41#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
42 friend class boost::serialization::access;
43 template<
class S>
void serialize(S&,
unsigned);
89 virtual void print(std::ostream&)
const override;
92 virtual bool operator<(
const Location&)
const override;
93 virtual bool operator<=(
const Location&)
const override;
94 virtual bool operator>(
const Location&)
const override;
95 virtual bool operator>=(
const Location&)
const override;
Concrete location of data.
int compare(const ConcreteLocation &) const
Compare two concrete locations.
RegisterDictionaryPtr registerDictionary() const
Property: Register dictionary.
Type type() const
Type of location.
virtual void print(std::ostream &) const override
Output location to a stream.
ConcreteLocation()
Default constructor.
void print(std::ostream &, const RegisterDictionaryPtr &) const
Print using the specified register dictionary.
virtual std::string toString() const override
Convert location to string.
ConcreteLocation(const ConcreteLocation &)
Copy constructor.
virtual bool isEqual(const Location &) const override
Equality and inequality.
void registerDictionary(const RegisterDictionaryPtr &)
Property: Register dictionary.
ConcreteLocation(RegisterDescriptor, const RegisterDictionaryPtr &)
Register location.
@ NO_LOCATION
Used by default-constructed locations.
@ REGISTER
Parameter is in a register.
@ RELATIVE
Parameter in memory relative to a register.
@ ABSOLUTE
Parameter is at a fixed memory address.
virtual bool isValid() const override
Test whether this object is valid.
RegisterDescriptor reg() const
Register part of the location.
ConcreteLocation(RegisterDescriptor, int64_t offset, const RegisterDictionaryPtr &)
Register and offset location.
rose_addr_t address() const
Address part of the location.
ConcreteLocation(RegisterDescriptor)
Register location.
ConcreteLocation(rose_addr_t)
Address location.
int64_t offset() const
Offset part of the location.
static ConcreteLocation parse(const std::string &)
Parse a concrete location from a string.
ConcreteLocation(RegisterDescriptor, int64_t offset)
Register and offset location.
virtual std::string printableName() const override
Convert location to escaped, parsable string.
Describes (part of) a physical CPU register.
Base class for location types.
Holds a value or nothing.