1#ifndef ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_MemoryCellState_H
2#define ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_MemoryCellState_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/MemoryCell.h>
7#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/MemoryState.h>
8#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
10#include <boost/serialization/access.hpp>
11#include <boost/serialization/base_object.hpp>
12#include <boost/serialization/export.hpp>
15namespace BinaryAnalysis {
16namespace InstructionSemantics {
37#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
39 friend class boost::serialization::access;
42 void serialize(S &s,
const unsigned ) {
43 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
MemoryState);
44 s & BOOST_SERIALIZATION_NVP(protocell);
45 s & BOOST_SERIALIZATION_NVP(latestWrittenCell_);
56 MemoryCellState(
const MemoryCellState &other);
66 ASSERT_not_null(retval);
78 return latestWrittenCell_;
81 latestWrittenCell_ = cell;
162#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
virtual std::vector< MemoryCellPtr > matchingCells(MemoryCell::Predicate &) const =0
Find all matching cells.
virtual void latestWrittenCell(const MemoryCellPtr &cell)
Property: Cell most recently written.
void eraseNonWritten()
Erase cells that have no writers.
virtual void updateReadProperties(const CellList &)
Adjust I/O properties after reading memory.
std::vector< MemoryCellPtr > allCells() const
All cells.
virtual AddressSet getWritersIntersection(const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps)=0
Writers for an address.
virtual MemoryCellPtr latestWrittenCell() const
Property: Cell most recently written.
MemoryCellStatePtr Ptr
Shared-ownership pointer.
virtual void eraseMatchingCells(MemoryCell::Predicate &)=0
Remove all matching cells.
virtual void eraseLeadingCells(MemoryCell::Predicate &)=0
Remove leading matching cells.
virtual void updateWriteProperties(const CellList &, InputOutputPropertySet)
Adjust I/O properties after writing memory.
virtual std::vector< MemoryCellPtr > leadingCells(MemoryCell::Predicate &) const =0
Find leading matching cells.
static MemoryCellStatePtr promote(const BaseSemantics::MemoryStatePtr &m)
Promote a base memory state pointer to a BaseSemantics::MemoryCellState pointer.
virtual void traverse(MemoryCell::Visitor &)=0
Traverse and modify cells.
virtual void clear() override
Clear memory.
virtual AddressSet getWritersUnion(const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps)=0
Writers for an address.
Predicate that always returns true.
Predicate for non-written cells.
Predicate for matching cells.
Visitor for traversing a cells.
Represents all memory in the state.
Base class for most instruction semantics RISC operators.
Base classes for instruction semantics.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
boost::shared_ptr< MemoryCell > MemoryCellPtr
Shared-ownership pointer to a memory cell.
std::list< MemoryCellPtr > CellList
List of memory cells.
boost::shared_ptr< class MemoryCellState > MemoryCellStatePtr
Shared-ownership pointer to a cell-based memory state.
Sawyer::SharedPointer< SValue > SValuePtr
Shared-ownership pointer to a semantic value in any domain.