-
Notifications
You must be signed in to change notification settings - Fork 459
remove value in svfvar #1636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove value in svfvar #1636
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1636 +/- ##
==========================================
- Coverage 63.73% 63.70% -0.03%
==========================================
Files 245 245
Lines 26017 25999 -18
Branches 4507 4509 +2
==========================================
- Hits 16582 16563 -19
- Misses 9435 9436 +1
|
@@ -247,15 +247,15 @@ void SVFIRBuilder::initialiseNodes() | |||
} | |||
else if (SVFUtil::isa<GlobalValue>(llvmValue)) | |||
{ | |||
pag->addGlobalValueValNode(iter->first, iter->second, icfgNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addGlobalValueValNode => addGlobalValNode
svf/include/SVFIR/SVFVariables.h
Outdated
@@ -582,7 +574,7 @@ class BaseObjVar : public ObjVar | |||
|
|||
protected: | |||
/// Constructor to create empty ObjVar (for SVFIRReader/deserialization) | |||
BaseObjVar(NodeID i, PNODEK ty = BaseObjNode) : ObjVar(i, ty) {} | |||
BaseObjVar(NodeID i, PNODEK ty = BaseObjNode) : ObjVar(i, ty), icfgNode(nullptr) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make icfgNode
as an argument rather than a default nullptr?
svf/include/SVFIR/SVFVariables.h
Outdated
@@ -919,12 +916,10 @@ class HeapObjVar: public BaseObjVar | |||
//@} | |||
|
|||
/// Constructor | |||
HeapObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, | |||
const SVFFunction* f, PNODEK ty = HeapObjNode): | |||
HeapObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, PNODEK ty = HeapObjNode): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need a default parameter "PNODEK ty = HeapObjNode"
svf/include/SVFIR/SVFVariables.h
Outdated
@@ -985,12 +980,10 @@ class StackObjVar: public BaseObjVar | |||
//@} | |||
|
|||
/// Constructor | |||
StackObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, | |||
const SVFFunction* fun, PNODEK ty = StackObjNode): | |||
StackObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, PNODEK ty = StackObjNode): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need a default parameter "PNODEK ty = StackObjNode"
svf/include/SVFIR/SVFVariables.h
Outdated
@@ -1137,10 +1130,15 @@ class GlobalValVar : public ValVar | |||
//@} | |||
|
|||
/// Constructor | |||
GlobalValVar(const SVFValue* val, NodeID i, const ICFGNode* icn, | |||
GlobalValVar(const SVFValue* val, NodeID i, const ICFGNode* icn, const SVFType* svfType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PNODEK ty = GlobalValNode
@@ -447,14 +418,12 @@ class ArgValVar: public ValVar | |||
|
|||
/// Constructor | |||
ArgValVar(NodeID i, u32_t argNo, const ICFGNode* icn, const CallGraphNode* callGraphNode, | |||
bool isUncalled = false, PNODEK ty = ArgNode); | |||
const SVFType* svfType, bool isUncalled = false); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make "bool isUncalled = false" as a method rather than a field?
@@ -582,7 +555,7 @@ class BaseObjVar : public ObjVar | |||
|
|||
protected: | |||
/// Constructor to create empty ObjVar (for SVFIRReader/deserialization) | |||
BaseObjVar(NodeID i, PNODEK ty = BaseObjNode) : ObjVar(i, ty) {} | |||
BaseObjVar(NodeID i, PNODEK ty = BaseObjNode, const ICFGNode* node = nullptr) : ObjVar(i, ty), icfgNode(node) {} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can icfgNode be a nullptr? It would be better to pass nullptr as an argument if it really has a null value.
--- log/nginx.log 2025-01-23 19:29:53.027556159 +1100 PTACallGraph Stats (Andersen analysis)****** @@ -220,11 +220,11 @@ Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector |
svf/include/SVFIR/SVFIR.h
Outdated
} | ||
} | ||
|
||
inline NodeID addBlackholeObjNode() | ||
inline NodeID addBlackholeObjNode(const ICFGNode* node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the argument here and make the nullptr at the constructor:
new DummyObjVar(getBlackHoleNode(), symInfo->getObjTypeInfo(getBlackHoleNode()), nullptr)
svf/include/SVFIR/SVFIR.h
Outdated
{ | ||
return addObjNode(new DummyObjVar(getConstantNode(), symInfo->getObjTypeInfo(getConstantNode()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
svf/include/SVFIR/SVFIR.h
Outdated
} | ||
inline NodeID addBlackholePtrNode() | ||
inline NodeID addBlackholePtrNode(const ICFGNode* node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
{ | ||
return addDummyValNode(NodeIDAllocator::get()->allocateValueId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addDummyValNode(const ICFGNode* node) => addDummyValNode()
svf/include/SVFIR/SVFIR.h
Outdated
{ | ||
return addDummyObjNode(NodeIDAllocator::get()->allocateObjectId(), type); | ||
return addDummyObjNode(NodeIDAllocator::get()->allocateObjectId(), type, node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addDummyObjNode(const SVFType* type, const ICFGNode* node) => addDummyObjNode(const SVFType* type)
svf/include/SVFIR/SVFIR.h
Outdated
} | ||
inline NodeID addDummyObjNode(NodeID i, const SVFType* type) | ||
inline NodeID addDummyObjNode(NodeID i, const SVFType* type, const ICFGNode* node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NodeID addDummyObjNode(NodeID i, const SVFType* type, const ICFGNode* node) => NodeID addDummyObjNode(NodeID i, const SVFType* type)
svf/include/SVFIR/SVFIR.h
Outdated
{ | ||
if (symInfo->idToObjTypeInfoMap().find(i) == symInfo->idToObjTypeInfoMap().end()) | ||
{ | ||
ObjTypeInfo* ti = symInfo->createObjTypeInfo(type); | ||
symInfo->idToObjTypeInfoMap()[i] = ti; | ||
return addObjNode(new DummyObjVar(i, ti, type)); | ||
return addObjNode(new DummyObjVar(i, ti, node, type)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return addObjNode(new DummyObjVar(i, ti, node, type)); => return addObjNode(new DummyObjVar(i, ti, nullptr, type));
--- log/nginx.log 2025-01-24 14:39:19.669260823 +1100 PTACallGraph Stats (Andersen analysis)****** Memory SSA Statistics****** Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector |
--- log/tmux.log 2025-01-24 14:20:57.992996185 +1100 PTACallGraph Stats (Andersen analysis)****** Memory SSA Statistics****** Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector |
* add svftype for some var and override getfunction * remove fun in SVFVar * fix icfgnode not initialized * add svftype * remove isPtr * remove svfvalue * rename * reformat * change name * add comments * don't use default nullptr icfgnode * fix comments * increase target coverage
No description provided.