30 #ifndef Z3_EXAMPLE_ADDRESSVALUE_H
31 #define Z3_EXAMPLE_ADDRESSVALUE_H
33 #define AddressMask 0x7f000000
34 #define FlippedAddressMask (AddressMask^0xffffffff)
36 #define BlackHoleAddr 0x7f000000 + 2
92 AddrSet::const_iterator
begin()
const
97 AddrSet::const_iterator
end()
const
130 bool changed =
false;
131 for (
const auto &addr: other)
146 for (
const auto &
id: other.
_addrs)
153 bool changed = (
_addrs != s);
194 std::stringstream rawStr(str);
202 for (
auto it =
_addrs.begin(), eit =
_addrs.end(); it!= eit; ++it)
204 rawStr << *it <<
", ";
215 assert(idx != 0 &&
"idx can’t be 0 because it represents a nullptr");
#define FlippedAddressMask
~AddressValue()=default
Default destructor.
bool meet_with(const AddressValue &other)
Return a intersected AddressValue.
bool equals(const AddressValue &rhs) const
void setVals(const AddrSet &vals)
const std::string toString() const
bool hasIntersect(const AddressValue &other)
AddressValue(const Set< u32_t > &addrs)
Constructor.
const AddrSet & getVals() const
static u32_t getInternalID(u32_t idx)
Return the internal index if idx is an address otherwise return the value of idx.
std::pair< AddressValue::AddrSet::iterator, bool > insert(u32_t id)
AddressValue()
Default constructor.
AddressValue(AddressValue &&other) noexcept
Move constructor.
bool contains(u32_t id) const
Return true if the AddressValue contains n.
AddrSet::const_iterator end() const
static u32_t getVirtualMemAddress(u32_t idx)
The physical address starts with 0x7f...... + idx.
static bool isVirtualMemAddress(u32_t val)
Check bit value of val start with 0x7F000000, filter by 0xFF000000.
AddressValue & operator=(AddressValue &&other) noexcept
Move operator=.
AddressValue(const AddressValue &other)
Copy constructor.
bool join_with(const AddressValue &other)
Current AddressValue joins with another AddressValue.
AddrSet::const_iterator begin() const
AddressValue & operator=(const AddressValue &other)
Copy operator=.
constexpr std::remove_reference< T >::type && move(T &&t) noexcept
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set