Skip to content

Commit

Permalink
Update svflib
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleisui committed Jan 17, 2025
1 parent b0abe21 commit 991e95a
Show file tree
Hide file tree
Showing 19 changed files with 362 additions and 374 deletions.
Binary file modified SVF-linux/Release-build/bin/ae
Binary file not shown.
Binary file modified SVF-linux/Release-build/bin/cfl
Binary file not shown.
Binary file modified SVF-linux/Release-build/bin/dvf
Binary file not shown.
Binary file modified SVF-linux/Release-build/bin/llvm2svf
Binary file not shown.
Binary file modified SVF-linux/Release-build/bin/mta
Binary file not shown.
Binary file modified SVF-linux/Release-build/bin/saber
Binary file not shown.
Binary file modified SVF-linux/Release-build/bin/svf-ex
Binary file not shown.
Binary file modified SVF-linux/Release-build/bin/wpa
Binary file not shown.
12 changes: 5 additions & 7 deletions SVF-linux/Release-build/include/DDA/DDAVFSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,6 @@ class DDAVFSolver
NodeID id = getPtrNodeID(var);
const BaseObjVar* baseObj = _pag->getBaseObject(id);
assert(baseObj && "base object is null??");
const MemObj* obj = _pag->getObject(id);
assert(obj && "object not found!!");
if(SVFUtil::isa<StackObjVar>(baseObj))
{
if(const SVFFunction* svffun = _pag->getGNode(id)->getFunction())
Expand Down Expand Up @@ -645,14 +643,14 @@ class DDAVFSolver

inline bool isArrayCondMemObj(const CVar& var) const
{
const MemObj* mem = _pag->getObject(getPtrNodeID(var));
assert(mem && "memory object is null??");
return mem->isArray();
const BaseObjVar* obj = _pag->getBaseObject(getPtrNodeID(var));
assert(obj && "base object is null??");
return obj->isArray();
}
inline bool isFieldInsenCondMemObj(const CVar& var) const
{
const MemObj* mem = _pag->getBaseObj(getPtrNodeID(var));
return mem->isFieldInsensitive();
const BaseObjVar* baseObj = _pag->getBaseObject(getPtrNodeID(var));
return baseObj->isFieldInsensitive();
}
//@}
private:
Expand Down
4 changes: 2 additions & 2 deletions SVF-linux/Release-build/include/Graphs/ConsG.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ class ConstraintGraph : public GenericGraph<ConstraintNode,ConstraintEdge>
}
inline bool isSingleFieldObj(NodeID id) const
{
const MemObj* mem = pag->getBaseObj(id);
return (mem->getMaxFieldOffsetLimit() == 1);
const BaseObjVar* baseObj = pag->getBaseObject(id);
return (baseObj->getMaxFieldOffsetLimit() == 1);
}
/// Get a field of a memory object
inline NodeID getGepObjVar(NodeID id, const APOffset& apOffset)
Expand Down
23 changes: 5 additions & 18 deletions SVF-linux/Release-build/include/Graphs/IRGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ class IRGraph : public GenericGraph<SVFVar, SVFStmt>
SymbolTableInfo* symInfo;

/// Add a node into the graph
inline NodeID addNode(SVFVar* node, NodeID i)
inline NodeID addNode(SVFVar* node)
{
addGNode(i,node);
return i;
assert(node && "cannot add a null node");
addGNode(node->getId(),node);
return node->getId();
}
/// Add an edge into the graph
bool addEdge(SVFVar* src, SVFVar* dst, SVFStmt* edge);
Expand All @@ -94,12 +95,6 @@ class IRGraph : public GenericGraph<SVFVar, SVFStmt>
inserted.first->second.emplace(edge);
}
}
/// get MemObj according to LLVM value
inline const MemObj* getMemObj(const SVFValue* val) const
{
return symInfo->getObj(symInfo->getObjSym(val));
}

public:
IRGraph(bool buildFromFile)
: fromFile(buildFromFile), nodeNumAfterPAGBuild(0), totalPTAPAGEdge(0)
Expand Down Expand Up @@ -174,22 +169,14 @@ class IRGraph : public GenericGraph<SVFVar, SVFStmt>
{
return symInfo->nullPtrSymID();
}
inline const MemObj* getBlackHoleObj() const
{
return symInfo->getBlkObj();
}
inline const MemObj* getConstantObj() const
{
return symInfo->getConstantObj();
}

inline u32_t getValueNodeNum() const
{
return symInfo->valSyms().size();
}
inline u32_t getObjectNodeNum() const
{
return symInfo->idToObjMap().size();
return symInfo->idToObjTypeInfoMap().size();
}
inline u32_t getNodeNumAfterPAGBuild() const
{
Expand Down
14 changes: 7 additions & 7 deletions SVF-linux/Release-build/include/MemoryModel/PointerAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ class PointerAnalysis

inline bool isArrayMemObj(NodeID id) const
{
const MemObj* mem = pag->getObject(id);
assert(mem && "memory object is null??");
return mem->isArray();
const BaseObjVar* obj = pag->getBaseObject(id);
assert(obj && "base object is null??");
return obj->isArray();
}
//@}

Expand Down Expand Up @@ -339,13 +339,13 @@ class PointerAnalysis
}
inline void setObjFieldInsensitive(NodeID id)
{
MemObj* mem = const_cast<MemObj*>(pag->getBaseObj(id));
mem->setFieldInsensitive();
BaseObjVar* baseObj = const_cast<BaseObjVar*>(pag->getBaseObject(id));
baseObj->setFieldInsensitive();
}
inline bool isFieldInsensitive(NodeID id) const
{
const MemObj* mem = pag->getBaseObj(id);
return mem->isFieldInsensitive();
const BaseObjVar* baseObj = pag->getBaseObject(id);
return baseObj->isFieldInsensitive();
}
///@}

Expand Down
4 changes: 2 additions & 2 deletions SVF-linux/Release-build/include/SVF-LLVM/SymbolTableBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ class SymbolTableBuilder
///Get a reference to StructInfo.
StInfo* getOrAddSVFTypeInfo(const Type* T);

MemObj* createBlkObj(SymID symId);
ObjTypeInfo* createBlkObjTypeInfo(SymID symId);

MemObj* createConstantObj(SymID symId);
ObjTypeInfo* createConstantObjTypeInfo(SymID symId);
};

} // End namespace SVF
Expand Down
12 changes: 0 additions & 12 deletions SVF-linux/Release-build/include/SVFIR/SVFFileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ class SVFMetadataAsValue;

class SVFLoopAndDomInfo; // Part of SVFFunction

// Classes created upon buildSymbolTableInfo
class MemObj;

// Classes created upon ICFG construction
class ICFGNode;
Expand Down Expand Up @@ -422,7 +420,6 @@ class SVFIRWriter

cJSON* toJson(const AccessPath& ap);
cJSON* toJson(const SVFLoop* loop);
cJSON* toJson(const MemObj* memObj);
cJSON* toJson(const ObjTypeInfo* objTypeInfo); // Only owned by MemObj
cJSON* toJson(const SVFLoopAndDomInfo* ldInfo); // Only owned by SVFFunction
cJSON* toJson(const StInfo* stInfo);
Expand Down Expand Up @@ -528,7 +525,6 @@ class SVFIRWriter

// Other classes
cJSON* contentToJson(const SVFLoop* loop);
cJSON* contentToJson(const MemObj* memObj); // Owned by SymbolTable->objMap
cJSON* contentToJson(const StInfo* stInfo);
///@}

Expand Down Expand Up @@ -899,13 +895,8 @@ class SymbolTableInfoReader

private:
const cJSON* symTabFieldJson = nullptr;
ReaderIDToObjMap<MemObj> memObjMap;

public:
inline MemObj* getMemObjPtr(unsigned id) const
{
return memObjMap.getPtr(id);
}

template <typename MemObjCreator>
void createObjs(const cJSON* symTabJson, MemObjCreator memObjCreator)
Expand All @@ -915,7 +906,6 @@ class SymbolTableInfoReader

const cJSON* const allMemObj = symTabJson->child;
CHECK_JSON_KEY(allMemObj);
memObjMap.createObjs(allMemObj, memObjCreator);

symTabFieldJson = allMemObj->next;
}
Expand Down Expand Up @@ -1104,7 +1094,6 @@ class SVFIRReader

void readJson(const cJSON* obj, AccessPath& ap);
void readJson(const cJSON* obj, SVFLoop*& loop);
void readJson(const cJSON* obj, MemObj*& memObj);
void readJson(const cJSON* obj,
ObjTypeInfo*& objTypeInfo); // Only owned by MemObj
void readJson(const cJSON* obj,
Expand Down Expand Up @@ -1257,7 +1246,6 @@ class SVFIRReader
void fill(const cJSON*& fieldJson, TDForkPE* stmt);
void fill(const cJSON*& fieldJson, TDJoinPE* stmt);

void fill(const cJSON*& fieldJson, MemObj* memObj);
void fill(const cJSON*& fieldJson, StInfo* stInfo);
// ICFG
void virtFill(const cJSON*& fieldJson, ICFGNode* node);
Expand Down
Loading

0 comments on commit 991e95a

Please sign in to comment.