Skip to content

Commit dd911f3

Browse files
committed
remove 1st arg of ICFGWTO
1 parent 52c2cab commit dd911f3

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

svf/include/AE/Core/ICFGWTO.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@ typedef WTOComponent<ICFG> ICFGWTOComp;
4545
typedef WTONode<ICFG> ICFGSingletonWTO;
4646
typedef WTOCycle<ICFG> ICFGCycleWTO;
4747

48-
// Added for IWTO
48+
/// Interprocedural Weak Topological Order
49+
/// Each IWTO has an entry ICFGNode within an function-level SCC boundary. Here scc is one or more functions.
4950
class ICFGWTO : public WTO<ICFG>
5051
{
5152
public:
5253
typedef WTO<ICFG> Base;
5354
typedef WTOComponentVisitor<ICFG>::WTONodeT ICFGWTONode;
5455
Set<const FunObjVar*> scc;
5556

56-
explicit ICFGWTO(ICFG* graph,const ICFGNode* node, Set<const FunObjVar*> funcScc = {}) :
57-
Base(graph, node), scc(funcScc)
57+
// 1st argument is the SCC's entry ICFGNode and 2nd argument is the function(s) in this SCC.
58+
explicit ICFGWTO(const ICFGNode* node, Set<const FunObjVar*> funcScc = {}) :
59+
Base(node), scc(funcScc)
5860
{
59-
if (scc.empty()) // if empty funcScc, default use the function of the node
61+
if (scc.empty()) // if funcScc is empty, the scc is the function itself
6062
scc.insert(node->getFun());
6163
}
6264

svf/include/Graphs/WTO.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,12 @@ template <typename GraphT> class WTO
554554
NodeRefToCycleDepthNumber _nodeToCDN;
555555
CycleDepthNumber _num;
556556
Stack _stack;
557-
GraphT* _graph;
558557
const NodeT* _entry;
559558

560559
public:
561560

562561
/// Compute the weak topological order of the given graph
563-
explicit WTO(GraphT* graph, const NodeT* entry) : _num(0), _graph(graph), _entry(entry)
562+
explicit WTO(const NodeT* entry) : _num(0), _entry(entry)
564563
{
565564
}
566565

svf/lib/AE/Svfexe/AbstractInterpretation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void AbstractInterpretation::initWTO()
137137
{
138138
funcScc.insert(callGraph->getGNode(node)->getFunction());
139139
}
140-
ICFGWTO* iwto = new ICFGWTO(icfg, icfg->getFunEntryICFGNode(fun), funcScc);
140+
ICFGWTO* iwto = new ICFGWTO(icfg->getFunEntryICFGNode(fun), funcScc);
141141
iwto->init();
142142
funcToWTO[it->second->getFunction()] = iwto;
143143
}

0 commit comments

Comments
 (0)