Skip to content

Conversation

@JasonZhongZexin
Copy link
Contributor

No description provided.

- add ICFG edges & nodes to graoh db [tested]

add options

update callgraph & icfg insert method

addSVFTypeNode2db[tested]

add struInfo2db [tested]

fix ICFGNode err [tested]

update SVFFunctionType (add params_types_vec to the node)

- add PAGNode & PAGEdge to db [tested]
- fixed cross join gql [tested]

update bbGraph Insertion [tested]
update  bb insertion [tested]
update bbEdge insertion [tested]
- read SVFType from db
- init PAGNode from db
- read SVFBBGraph from db
- read ICFG from db

read ICFG edge from db [tested & checked]

- read & write pag edge [tested]
- fixed stat err
- rename graphdb related function name

refactoring node/edge db insertStmt

update ICFGNodes attrubuites
"update allICFGNode of BB from DB result"

add node location info to db

fix rebase err
update

update

update

test ci

update ci

update ci

update ci

update ci

updtae ci

update

update graphDBClient and cmake configuration

update

clean db client

clean code

update
reslove confilt
@codecov
Copy link

codecov bot commented Nov 2, 2025

Codecov Report

❌ Patch coverage is 77.17391% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.03%. Comparing base (c711dc3) to head (d2891e6).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
svf/lib/SVFIR/SVFStatements.cpp 0.00% 19 Missing ⚠️
svf/lib/SABER/LeakChecker.cpp 23.07% 10 Missing ⚠️
svf/lib/SVFIR/SVFIR.cpp 93.15% 5 Missing ⚠️
svf/include/SVFIR/SVFIR.h 78.94% 4 Missing ⚠️
svf/include/SVFIR/SVFStatements.h 0.00% 2 Missing ⚠️
svf/lib/SVFIR/SVFValue.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1764      +/-   ##
==========================================
+ Coverage   64.00%   64.03%   +0.02%     
==========================================
  Files         244      243       -1     
  Lines       24454    24541      +87     
  Branches     4611     4612       +1     
==========================================
+ Hits        15653    15716      +63     
- Misses       8801     8825      +24     
Files with missing lines Coverage Δ
svf-llvm/include/SVF-LLVM/ICFGBuilder.h 100.00% <100.00%> (ø)
svf-llvm/include/SVF-LLVM/SVFIRBuilder.h 89.81% <ø> (ø)
svf-llvm/lib/LLVMUtil.cpp 75.09% <100.00%> (+0.18%) ⬆️
svf-llvm/lib/SVFIRBuilder.cpp 87.29% <100.00%> (+0.31%) ⬆️
svf-llvm/tools/SABER/saber.cpp 85.71% <ø> (ø)
svf-llvm/tools/WPA/wpa.cpp 100.00% <100.00%> (+12.50%) ⬆️
svf/include/Graphs/BasicBlockG.h 96.55% <100.00%> (+0.06%) ⬆️
svf/include/Graphs/CHG.h 94.73% <ø> (ø)
svf/include/Graphs/CallGraph.h 94.23% <100.00%> (ø)
svf/include/Graphs/ICFG.h 97.95% <100.00%> (+0.08%) ⬆️
... and 21 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

/**
* set the call edge lanbel counter for the new statements, this is used when loading statements from DB
*/
inline void setCallEdgeLabelCounter(u64_t counter)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the below counter methods? I thought this is done during each edge adding?

Comment on lines +274 to +297
static inline const Inst2LabelMap* getInst2LabelMap()
{
return &inst2LabelMap;
}

static inline const Var2LabelMap* getVar2LabelMap()
{
return &var2LabelMap;
}

static inline const u64_t* getCallEdgeLabelCounter()
{
return &callEdgeLabelCounter;
}

static inline const u64_t* getStoreEdgeLabelCounter()
{
return &storeEdgeLabelCounter;
}

static inline const u64_t* getMultiOpndLabelCounter()
{
return &multiOpndLabelCounter;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we return references rather than pointers? Also the counter methods look very odd to me.

}

__attribute__((weak))
const bool SVFValue::hasLLVMValue() const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a real implementation in the front-end, in case it won't always crash here.

Comment on lines 351 to 384
CallPE::CallPE(SVFVar* s, SVFVar* d, GEdgeFlag k, EdgeID eid, SVFVar* value, ICFGNode* icfgNode, const CallICFGNode* call,
const FunEntryICFGNode* entry): AssignStmt(s, d, k, eid, value, icfgNode), call(call), entry(entry)
{

}

RetPE::RetPE(SVFVar* s, SVFVar* d, const CallICFGNode* i,
const FunExitICFGNode* e, GEdgeKind k)
: AssignStmt(s, d, makeEdgeFlagWithCallInst(k, i)), call(i), exit(e)
{
}

RetPE::RetPE(SVFVar* s, SVFVar* d, GEdgeFlag k, EdgeID eid, SVFVar* value, ICFGNode* icfgNode, const CallICFGNode* call,
const FunExitICFGNode* exit): AssignStmt(s, d, k, eid, value, icfgNode), call(call), exit(exit) {}

MultiOpndStmt::MultiOpndStmt(SVFVar* r, const OPVars& opnds, GEdgeFlag k)
: SVFStmt(opnds.at(0), r, k), opVars(opnds)
{
}

CmpStmt::CmpStmt(SVFVar* s, const OPVars& opnds, u32_t pre)
: MultiOpndStmt(s, opnds,
makeEdgeFlagWithAddionalOpnd(SVFStmt::Cmp, opnds.at(1))),
predicate(pre)
{
assert(opnds.size() == 2 && "CmpStmt can only have two operands!");
}

CmpStmt::CmpStmt(SVFVar* s, SVFVar* d, GEdgeFlag k, EdgeID eid, SVFVar* value, u32_t predicate, ICFGNode* icfgNode, const OPVars& opnds)
: MultiOpndStmt(s, d, k, eid, value, icfgNode, opnds), predicate(predicate)
{
assert(opnds.size() == 2 && "CmpStmt can only have two operands!");
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All new methods for GraphDB go to protected.

}
}

SVFStmt::SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k, EdgeID eid, SVFVar* value, ICFGNode* icfgNode, bool real) :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only for GraphDB, put it under protected if it is not.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this protected constructor.

&& "this node should not be created before");
GepValObjMap[curInst][std::make_pair(base, ap)] = i;
GepValVar *node = new GepValVar(baseVar, i, ap, type, icn);
node->setLLVMVarInstID(curInst);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to set the instruction here?

if (success)
{
outs() << sucMsg("\t SUCCESS :") << funName << " check <src id:" << source->getId()
if ((getSrcCSID(source))->hasLLVMValue())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to have this hasLLVMValue()?

}
}

void CallGraph::addIndirectCallGraphEdge(CallGraphEdge* cgEdge)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this method if it is the same as addEdge?

u32_t argNo;

protected:
ArgValVar(NodeID i, const SVFType* type, u32_t argNo, PNODEK ty = ArgValNode) : ValVar(i, type, ty), argNo(argNo) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to revisit many of the protected constructors you added, in fact you could reuse the existing constructors by passing null for some arguments.

friend class GraphDBClient;

protected:
IntraICFGNode(NodeID id, const SVFBasicBlock* b, const FunObjVar* f, bool isReturn): ICFGNode(id, IntraBlock),isRet(isReturn)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this new constructor. Could we reuse the exisitng one? Why we need to pass funobjvar?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to revisit the constructors you added for other classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants