svf-tools 1.0.1038 → 1.0.1039

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1038",
3
+ "version": "1.0.1039",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -123,14 +123,30 @@ public:
123
123
 
124
124
 
125
125
  // Return a handle to the stack of nodes in topological
126
- // order. This will be used to seed the initial solution
126
+ // order. This will be used to seed the initial solution
127
127
  // and improve efficiency.
128
128
  inline GNodeStack &topoNodeStack()
129
129
  {
130
130
  return _T;
131
131
  }
132
132
 
133
- const inline GNODESCCInfoMap &GNodeSCCInfo() const
133
+ /// Return a handle to the stack of nodes in reverse topological
134
+ /// order. This will be used to seed the initial solution
135
+ /// and improve efficiency.
136
+ inline GNodeStack revTopoNodeStack()
137
+ {
138
+ GNodeStack revTopoOrder;
139
+ GNodeStack topoOrder = topoNodeStack();
140
+ while(!topoOrder.empty())
141
+ {
142
+ NodeID nodeID = topoOrder.top();
143
+ topoOrder.pop();
144
+ revTopoOrder.push(nodeID);
145
+ }
146
+ return revTopoOrder;
147
+ }
148
+
149
+ const inline GNODESCCInfoMap &GNodeSCCInfo() const
134
150
  {
135
151
  return _NodeSCCAuxInfo;
136
152
  }
@@ -69,31 +69,23 @@ protected:
69
69
  /// SCC detection
70
70
  this->getSCCDetector()->find();
71
71
 
72
+ assert(nodeStack.empty() && "node stack is not empty, some nodes are not popped properly.");
73
+
72
74
  /// Both rep and sub nodes need to be processed later.
73
75
  /// Collect sub nodes from SCCDetector.
74
- NodeStack revTopoStack;
75
- NodeStack& topoStack = this->getSCCDetector()->topoNodeStack();
76
- while (!topoStack.empty())
76
+ NodeStack revTopoStack = this->getSCCDetector()->revTopoNodeStack();
77
+ while (!revTopoStack.empty())
77
78
  {
78
- NodeID nodeId = topoStack.top();
79
- topoStack.pop();
79
+ NodeID nodeId = revTopoStack.top();
80
+ revTopoStack.pop();
80
81
  const NodeBS& subNodes = this->getSCCDetector()->subNodes(nodeId);
81
82
  for (NodeBS::iterator it = subNodes.begin(), eit = subNodes.end(); it != eit; ++it)
82
83
  {
83
- revTopoStack.push(*it);
84
+ /// restore the topological order.
85
+ nodeStack.push(*it);
84
86
  }
85
87
  }
86
88
 
87
- assert(nodeStack.empty() && "node stack is not empty, some nodes are not popped properly.");
88
-
89
- /// restore the topological order.
90
- while (!revTopoStack.empty())
91
- {
92
- NodeID nodeId = revTopoStack.top();
93
- revTopoStack.pop();
94
- nodeStack.push(nodeId);
95
- }
96
-
97
89
  return nodeStack;
98
90
  }
99
91
  };
@@ -461,12 +461,11 @@ bool MRGenerator::addModSideEffectOfCallSite(const CallICFGNode* cs, const NodeB
461
461
  */
462
462
  void MRGenerator::getCallGraphSCCRevTopoOrder(WorkList& worklist)
463
463
  {
464
-
465
- NodeStack& topoOrder = callGraphSCC->topoNodeStack();
466
- while(!topoOrder.empty())
464
+ NodeStack revTopoNodeStack = callGraphSCC->revTopoNodeStack();
465
+ while(!revTopoNodeStack.empty())
467
466
  {
468
- NodeID callgraphNodeID = topoOrder.top();
469
- topoOrder.pop();
467
+ NodeID callgraphNodeID = revTopoNodeStack.top();
468
+ revTopoNodeStack.pop();
470
469
  worklist.push(callgraphNodeID);
471
470
  }
472
471
  }
@@ -709,25 +709,16 @@ inline void Andersen::collapseFields()
709
709
  */
710
710
  void Andersen::mergeSccCycle()
711
711
  {
712
- NodeStack revTopoOrder;
713
- NodeStack & topoOrder = getSCCDetector()->topoNodeStack();
714
- while (!topoOrder.empty())
712
+ NodeStack revTopoOrder = getSCCDetector()->revTopoNodeStack();
713
+ while (!revTopoOrder.empty())
715
714
  {
716
- NodeID repNodeId = topoOrder.top();
717
- topoOrder.pop();
718
- revTopoOrder.push(repNodeId);
715
+ NodeID repNodeId = revTopoOrder.top();
716
+ revTopoOrder.pop();
717
+
719
718
  const NodeBS& subNodes = getSCCDetector()->subNodes(repNodeId);
720
719
  // merge sub nodes to rep node
721
720
  mergeSccNodes(repNodeId, subNodes);
722
721
  }
723
-
724
- // restore the topological order for later solving.
725
- while (!revTopoOrder.empty())
726
- {
727
- NodeID nodeId = revTopoOrder.top();
728
- revTopoOrder.pop();
729
- topoOrder.push(nodeId);
730
- }
731
722
  }
732
723
 
733
724