58 assert(
false &&
"No preAbsTrace for this node");
104 if (SVFUtil::isa<ConstNullPtrValVar>(
var))
109 if (SVFUtil::isa<ConstDataValVar>(
var))
123 if (
as.inVarToValTable(
id) ||
as.inVarToAddrsTable(
id))
172 assert(
false &&
"Unknown SVFVar kind");
187 if (SVFUtil::isa<ConstIntValVar>(
var) || SVFUtil::isa<ConstFPValVar>(
var) ||
188 SVFUtil::isa<ConstNullPtrValVar>(
var) || SVFUtil::isa<ConstDataValVar>(
var))
199 (
it->second.inVarToValTable(
id) ||
it->second.inVarToAddrsTable(
id)))
229 return it->second.getLocToVal().count(
objId) != 0;
273 assert(
false &&
"Unknown SVFVar kind");
325 if (
gep->isConstantOffset())
329 for (
int i =
gep->getOffsetVarAndGepTypePairVec().size() - 1;
i >= 0;
i--)
331 const ValVar*
var =
gep->getOffsetVarAndGepTypePairVec()[
i].first;
349 if (SVFUtil::isa<SVFPointerType>(
type))
351 u32_t elemNum =
gep->getAccessPath().getElementNum(
gep->getAccessPath().gepSrcPointeeType());
382 if (
gep->isConstantOffset())
386 for (
int i =
gep->getOffsetVarAndGepTypePairVec().size() - 1;
i >= 0;
i--)
397 elemByteSize =
gep->getAccessPath().gepSrcPointeeType()->getByteSize();
399 assert(
false &&
"idxOperandType must be ArrType or PtrType");
433 assert(
false &&
"gep type pair only support arr/ptr/struct");
515 const std::vector<SVFVar*>&
sizes =
addr->getArrSize();
530 assert(
false &&
"Addr rhs value is not ObjVar");
542 assert(
svfg &&
"SVFG is not built for sparse AE");
555 assert(
svfg &&
"SVFG is not built for sparse AE");
561 for (
const auto*
edge : node->getOutEdges())
571 assert(
svfg &&
"SVFG is not built for sparse AE");
574 return var->getICFGNode();
581 assert(
svfg &&
"SVFG is not built for sparse AE");
585 return edge->getSrcNode();
void storeValue(const ValVar *pointer, const AbstractValue &val, const ICFGNode *node)
void updateAbstractValue(const ValVar *var, const AbstractValue &val, const ICFGNode *node)
Write a top-level variable's abstract value into abstractTrace[node].
IntervalValue getGepByteOffset(const GepStmt *gep)
Compute the byte offset for a GepStmt.
AbstractState & getAbstractState(const ICFGNode *node)
Retrieve the abstract state for a given ICFG node. Asserts if absent.
u32_t getAllocaInstByteSize(const AddrStmt *addr)
Get the byte size of a stack allocation.
bool hasAbstractState(const ICFGNode *node)
Check if an abstract state exists for a given ICFG node.
bool hasAbstractValue(const ValVar *var, const ICFGNode *node) const
const AbstractValue & getAbstractValue(const ValVar *var, const ICFGNode *node)
IntervalValue getGepElementIndex(const GepStmt *gep)
Compute the flattened element index for a GepStmt.
const ICFGNode * getDefSiteOfValVar(const ValVar *var) const
Given a ValVar, find its definition-site ICFGNode.
Set< const ICFGNode * > getUseSitesOfObjVar(const ObjVar *obj, const ICFGNode *node) const
Given an ObjVar and its use-site ICFGNode, find all downstream use-site ICFGNodes.
const ICFGNode * getDefSiteOfObjVar(const ObjVar *obj, const ICFGNode *node) const
Given an ObjVar and its use-site ICFGNode, find the definition-site ICFGNode.
AddressValue getGepObjAddrs(const ValVar *pointer, IntervalValue offset)
Compute GEP object addresses for a pointer at a given element offset.
AbstractValue loadValue(const ValVar *pointer, const ICFGNode *node)
const SVFType * getPointeeElement(const ObjVar *var, const ICFGNode *node)
Get the pointee type for a pointer variable.
Map< const ICFGNode *, AbstractState > abstractTrace
AbstractStateManager(SVFIR *svfir, AndersenWaveDiff *pta)
Set< const ICFGNode * > getUseSitesOfValVar(const ValVar *var) const
Given a ValVar, find all use-site ICFGNodes.
void updateAbstractState(const ICFGNode *node, const AbstractState &state)
const VarToAbsValMap & getVarToVal() const
get var2val map
u32_t getIDFromAddr(u32_t addr) const
Return the internal index if addr is an address otherwise return the value of idx.
static u32_t getVirtualMemAddress(u32_t idx)
The physical address starts with 0x7f...... + idx.
void join_with(const AbstractValue &other)
IntervalValue & getInterval()
AddressValue & getAddrs()
bool isConstantByteSize() const
Check if byte size is a const value.
u32_t getByteSizeOfObj() const
Get the byte size of this object.
const SVFType * getType() const
Get obj type.
s64_t getIntNumeral() const
const GEdgeSetTy & getOutEdges() const
const GEdgeSetTy & getInEdges() const
u32_t getFlattenedElemIdx(const SVFType *T, u32_t origId)
Flattened element idx of an array or struct by considering stride.
const StInfo * getTypeInfo(const SVFType *T) const
Get struct info.
void meet_with(const IntervalValue &other)
Return a intersected IntervalValue.
static IntervalValue top()
Create the IntervalValue [-inf, +inf].
const BoundedInt & lb() const
Return the lower bound.
static Option< bool > ModelArrays
static const OptionMap< u32_t > AESparsity
static const Option< u32_t > MaxFieldLimit
Maximum number of field derivations for an object.
SVFG * buildFullSVFG(BVDataPTAImpl *pta)
const ICFGNode * getDefSiteOfValVar(const ValVar *var) const
const Set< const ICFGNode * > getUseSitesOfValVar(const ValVar *var) const
const ICFGNode * getDefSiteOfObjVar(const ObjVar *obj, const ICFGNode *node) const
const Set< const ICFGNode * > getUseSitesOfObjVar(const ObjVar *obj, const ICFGNode *node) const
const BaseObjVar * getBaseObject(NodeID id) const
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
const GepObjVar * getGepObjVar(NodeID id) const
u32_t getByteSize() const
NodeID getId() const
Get ID.
std::vector< u32_t > & getFlattenedElemIdxVec()
const ICFGNode * getICFGNode() const
llvm::IRBuilder IRBuilder