Static Value-Flow Analysis
|
#include <AbstractState.h>
Public Types | |
typedef Map< u32_t, AbstractValue > | VarToAbsValMap |
typedef VarToAbsValMap | AddrToAbsValMap |
Public Member Functions | |
AbstractState () | |
default constructor More... | |
AbstractState (VarToAbsValMap &_varToValMap, AddrToAbsValMap &_locToValMap) | |
AbstractState (const AbstractState &rhs) | |
copy constructor More... | |
virtual | ~AbstractState ()=default |
AddressValue | getGepObjAddrs (u32_t pointer, IntervalValue offset) |
void | initObjVar (ObjVar *objVar) |
IntervalValue | getElementIndex (const GepStmt *gep) |
IntervalValue | getByteOffset (const GepStmt *gep) |
AbstractValue | loadValue (NodeID varId) |
void | storeValue (NodeID varId, AbstractValue val) |
u32_t | getAllocaInstByteSize (const AddrStmt *addr) |
AbstractState & | operator= (const AbstractState &rhs) |
AbstractState (AbstractState &&rhs) | |
move constructor More... | |
AbstractState & | operator= (AbstractState &&rhs) |
operator= move constructor More... | |
AbstractState | bottom () const |
Set all value bottom. More... | |
AbstractState | top () const |
Set all value top. More... | |
AbstractState | sliceState (Set< u32_t > &sl) |
Copy some values and return a new IntervalExeState. More... | |
virtual AbstractValue & | operator[] (u32_t varId) |
get abstract value of variable More... | |
virtual const AbstractValue & | operator[] (u32_t varId) const |
get abstract value of variable More... | |
bool | inVarToAddrsTable (u32_t id) const |
whether the variable is in varToAddrs table More... | |
virtual bool | inVarToValTable (u32_t id) const |
whether the variable is in varToVal table More... | |
bool | inAddrToAddrsTable (u32_t id) const |
whether the memory address stores memory addresses More... | |
virtual bool | inAddrToValTable (u32_t id) const |
whether the memory address stores abstract value More... | |
const VarToAbsValMap & | getVarToVal () const |
get var2val map More... | |
const AddrToAbsValMap & | getLocToVal () const |
get loc2val map More... | |
AbstractState | widening (const AbstractState &other) |
domain widen with other, and return the widened domain More... | |
AbstractState | narrowing (const AbstractState &other) |
domain narrow with other, and return the narrowed domain More... | |
void | joinWith (const AbstractState &other) |
domain join with other, important! other widen this. More... | |
void | meetWith (const AbstractState &other) |
domain meet with other, important! other widen this. More... | |
const SVFType * | getPointeeElement (NodeID id) |
u32_t | hash () const |
void | store (u32_t addr, const AbstractValue &val) |
virtual AbstractValue & | load (u32_t addr) |
void | printAbstractState () const |
std::string | toString () const |
bool | equals (const AbstractState &other) const |
bool | operator== (const AbstractState &rhs) const |
bool | operator!= (const AbstractState &rhs) const |
bool | operator< (const AbstractState &rhs) const |
bool | operator>= (const AbstractState &rhs) const |
void | clear () |
Static Public Member Functions | |
static u32_t | getVirtualMemAddress (u32_t idx) |
The physical address starts with 0x7f...... + idx. More... | |
static bool | isVirtualMemAddress (u32_t val) |
Check bit value of val start with 0x7F000000, filter by 0xFF000000. More... | |
static u32_t | getInternalID (u32_t idx) |
Return the internal index if idx is an address otherwise return the value of idx. More... | |
static bool | isNullPtr (u32_t addr) |
static bool | eqVarToValMap (const VarToAbsValMap &lhs, const VarToAbsValMap &rhs) |
static bool | lessThanVarToValMap (const VarToAbsValMap &lhs, const VarToAbsValMap &rhs) |
static bool | geqVarToValMap (const VarToAbsValMap &lhs, const VarToAbsValMap &rhs) |
Protected Attributes | |
VarToAbsValMap | _varToAbsVal |
Map a variable (symbol) to its abstract value. More... | |
AddrToAbsValMap | _addrToAbsVal |
Map a memory address to its stored abstract value. More... | |
Friends | |
class | SVFIR2AbsState |
class | RelationSolver |
Definition at line 58 of file AbstractState.h.
Definition at line 65 of file AbstractState.h.
Definition at line 63 of file AbstractState.h.
|
inline |
|
inline |
Definition at line 73 of file AbstractState.h.
|
inline |
copy constructor
Definition at line 76 of file AbstractState.h.
|
virtualdefault |
|
inline |
move constructor
Definition at line 135 of file AbstractState.h.
|
inline |
|
inline |
Definition at line 395 of file AbstractState.h.
bool AbstractState::equals | ( | const AbstractState & | other | ) | const |
Definition at line 37 of file AbstractState.cpp.
|
inlinestatic |
Definition at line 326 of file AbstractState.h.
|
inlinestatic |
Definition at line 357 of file AbstractState.h.
Definition at line 494 of file AbstractState.cpp.
IntervalValue AbstractState::getByteOffset | ( | const GepStmt * | gep | ) |
Definition at line 305 of file AbstractState.cpp.
IntervalValue AbstractState::getElementIndex | ( | const GepStmt * | gep | ) |
Definition at line 232 of file AbstractState.cpp.
AddressValue AbstractState::getGepObjAddrs | ( | u32_t | pointer, |
IntervalValue | offset | ||
) |
Definition at line 156 of file AbstractState.cpp.
Return the internal index if idx is an address otherwise return the value of idx.
Definition at line 114 of file AbstractState.h.
|
inline |
get loc2val map
Definition at line 266 of file AbstractState.h.
if this NodeID in SVFIR is a pointer, get the pointee type e.g arr = (int*) malloc(10*sizeof(int)) getPointeeType(arr) -> return int we can set arr[0]='c', arr[1]='c', arr[2]='\0'
call | callnode of memset like api |
Definition at line 473 of file AbstractState.cpp.
|
inline |
get var2val map
Definition at line 260 of file AbstractState.h.
The physical address starts with 0x7f...... + idx.
Definition at line 102 of file AbstractState.h.
u32_t AbstractState::hash | ( | ) | const |
Definition at line 42 of file AbstractState.cpp.
|
inline |
|
inlinevirtual |
void AbstractState::initObjVar | ( | ObjVar * | objVar | ) |
Definition at line 179 of file AbstractState.cpp.
|
inline |
|
inlinevirtual |
|
inlinestatic |
Definition at line 119 of file AbstractState.h.
|
inlinestatic |
Check bit value of val start with 0x7F000000, filter by 0xFF000000.
Definition at line 108 of file AbstractState.h.
void AbstractState::joinWith | ( | const AbstractState & | other | ) |
domain join with other, important! other widen this.
Definition at line 102 of file AbstractState.cpp.
|
inlinestatic |
Definition at line 343 of file AbstractState.h.
|
inlinevirtual |
Definition at line 307 of file AbstractState.h.
AbstractValue AbstractState::loadValue | ( | NodeID | varId | ) |
Definition at line 373 of file AbstractState.cpp.
void AbstractState::meetWith | ( | const AbstractState & | other | ) |
domain meet with other, important! other widen this.
Definition at line 133 of file AbstractState.cpp.
AbstractState AbstractState::narrowing | ( | const AbstractState & | other | ) |
domain narrow with other, and return the narrowed domain
Definition at line 80 of file AbstractState.cpp.
|
inline |
Definition at line 379 of file AbstractState.h.
|
inline |
Definition at line 384 of file AbstractState.h.
|
inline |
|
inline |
Definition at line 124 of file AbstractState.h.
|
inline |
Definition at line 373 of file AbstractState.h.
|
inline |
Definition at line 390 of file AbstractState.h.
|
inlinevirtual |
get abstract value of variable
Definition at line 196 of file AbstractState.h.
|
inlinevirtual |
get abstract value of variable
Definition at line 202 of file AbstractState.h.
void AbstractState::printAbstractState | ( | ) | const |
Definition at line 391 of file AbstractState.cpp.
|
inline |
|
inline |
Definition at line 299 of file AbstractState.h.
void AbstractState::storeValue | ( | NodeID | varId, |
AbstractValue | val | ||
) |
Definition at line 383 of file AbstractState.cpp.
|
inline |
|
inline |
Definition at line 318 of file AbstractState.h.
AbstractState AbstractState::widening | ( | const AbstractState & | other | ) |
domain widen with other, and return the widened domain
Definition at line 59 of file AbstractState.cpp.
|
friend |
Definition at line 61 of file AbstractState.h.
|
friend |
Definition at line 60 of file AbstractState.h.
|
protected |
Map a memory address to its stored abstract value.
Definition at line 190 of file AbstractState.h.
|
protected |
Map a variable (symbol) to its abstract value.
Definition at line 188 of file AbstractState.h.