46#ifndef Z3_EXAMPLE_INTERVAL_DOMAIN_H
47#define Z3_EXAMPLE_INTERVAL_DOMAIN_H
156 for (
auto &
item:
inv._varToAbsVal)
158 if (
item.second.isInterval())
159 item.second.getInterval().set_to_bottom();
168 for (
auto &
item:
inv._varToAbsVal)
170 if (
item.second.isInterval())
171 item.second.getInterval().set_to_top();
328 if (
lhs.size() !=
rhs.size())
return false;
334 if (!
item.second.equals(
it->second))
345 if (
lhs.empty())
return !
rhs.empty();
349 if (
it ==
rhs.end())
return false;
351 if (
item.second.getInterval().contain(
it->second.getInterval()))
return false;
359 if (
rhs.empty())
return true;
363 if (
it ==
lhs.end())
return false;
365 if (!
it->second.getInterval().contain(
366 item.second.getInterval()))
381 return !(*
this ==
rhs);
386 return !(*
this >=
rhs);
const AddrToAbsValMap & getLocToVal() const
get loc2val map
u32_t getAllocaInstByteSize(const AddrStmt *addr)
const VarToAbsValMap & getVarToVal() const
get var2val map
static bool geqVarToValMap(const VarToAbsValMap &lhs, const VarToAbsValMap &rhs)
bool operator>=(const AbstractState &rhs) const
void store(u32_t addr, const AbstractValue &val)
friend class SVFIR2AbsState
AbstractState bottom() const
Set all value bottom.
virtual bool inAddrToValTable(u32_t id) const
whether the memory address stores abstract value
void printAbstractState() const
bool inAddrToAddrsTable(u32_t id) const
whether the memory address stores memory addresses
void joinWith(const AbstractState &other)
domain join with other, important! other widen this.
AbstractState(const AbstractState &rhs)
copy constructor
bool operator!=(const AbstractState &rhs) const
virtual const AbstractValue & operator[](u32_t varId) const
get abstract value of variable
IntervalValue getElementIndex(const GepStmt *gep)
bool equals(const AbstractState &other) const
AbstractState(AbstractState &&rhs)
move constructor
VarToAbsValMap _varToAbsVal
Map a variable (symbol) to its abstract value.
std::string toString() const
AddrToAbsValMap _addrToAbsVal
Map a memory address to its stored abstract value.
const SVFType * getPointeeElement(NodeID id)
AbstractState & operator=(AbstractState &&rhs)
operator= move constructor
static bool lessThanVarToValMap(const VarToAbsValMap &lhs, const VarToAbsValMap &rhs)
virtual AbstractValue & load(u32_t addr)
AbstractState(VarToAbsValMap &_varToValMap, AddrToAbsValMap &_locToValMap)
IntervalValue getByteOffset(const GepStmt *gep)
AbstractValue loadValue(NodeID varId)
bool inVarToAddrsTable(u32_t id) const
whether the variable is in varToAddrs table
static u32_t getVirtualMemAddress(u32_t idx)
The physical address starts with 0x7f...... + idx.
virtual AbstractValue & operator[](u32_t varId)
get abstract value of variable
AbstractState narrowing(const AbstractState &other)
domain narrow with other, and return the narrowed domain
static u32_t getInternalID(u32_t idx)
Return the internal index if idx is an address otherwise return the value of idx.
AbstractState()
default constructor
static bool isNullPtr(u32_t addr)
virtual bool inVarToValTable(u32_t id) const
whether the variable is in varToVal table
Map< u32_t, AbstractValue > VarToAbsValMap
virtual ~AbstractState()=default
VarToAbsValMap AddrToAbsValMap
AbstractState top() const
Set all value top.
bool operator==(const AbstractState &rhs) const
AbstractState & operator=(const AbstractState &rhs)
static bool isVirtualMemAddress(u32_t val)
Check bit value of val start with 0x7F000000, filter by 0xFF000000.
void storeValue(NodeID varId, AbstractValue val)
static bool eqVarToValMap(const VarToAbsValMap &lhs, const VarToAbsValMap &rhs)
void meetWith(const AbstractState &other)
domain meet with other, important! other widen this.
bool operator<(const AbstractState &rhs) const
AddressValue getGepObjAddrs(u32_t pointer, IntervalValue offset)
AbstractState sliceState(Set< u32_t > &sl)
Copy some values and return a new IntervalExeState.
void initObjVar(ObjVar *objVar)
AbstractState widening(const AbstractState &other)
domain widen with other, and return the widened domain
static u32_t getInternalID(u32_t idx)
Return the internal index if idx is an address otherwise return the value of idx.
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.
llvm::IRBuilder IRBuilder