svf-tools 1.0.549 → 1.0.552

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.
Files changed (70) hide show
  1. package/SVF-doxygen/html/html/ExtAPI_8cpp_source.html +38 -41
  2. package/SVF-doxygen/html/html/ExtAPI_8h_source.html +70 -81
  3. package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +2 -4
  4. package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +9 -10
  5. package/SVF-doxygen/html/html/SVFUtil_8h_source.html +7 -7
  6. package/SVF-doxygen/html/html/VersionedFlowSensitive_8cpp_source.html +28 -28
  7. package/SVF-doxygen/html/html/VersionedFlowSensitive_8h_source.html +27 -27
  8. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI-members.html +24 -36
  9. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI.html +141 -224
  10. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI_1_1Operation-members.html +8 -7
  11. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI_1_1Operation.html +81 -56
  12. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +1 -1
  13. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +60 -76
  14. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +84 -82
  15. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive_1_1SCC.html +8 -8
  16. package/SVF-doxygen/html/html/functions_a.html +6 -9
  17. package/SVF-doxygen/html/html/functions_c.html +2 -2
  18. package/SVF-doxygen/html/html/functions_e.html +2 -35
  19. package/SVF-doxygen/html/html/functions_enum.html +0 -3
  20. package/SVF-doxygen/html/html/functions_eval_e.html +0 -30
  21. package/SVF-doxygen/html/html/functions_f.html +3 -3
  22. package/SVF-doxygen/html/html/functions_func_g.html +20 -17
  23. package/SVF-doxygen/html/html/functions_func_o.html +1 -1
  24. package/SVF-doxygen/html/html/functions_func_p.html +3 -3
  25. package/SVF-doxygen/html/html/functions_func_s.html +10 -13
  26. package/SVF-doxygen/html/html/functions_g.html +21 -18
  27. package/SVF-doxygen/html/html/functions_i.html +6 -6
  28. package/SVF-doxygen/html/html/functions_l.html +3 -3
  29. package/SVF-doxygen/html/html/functions_o.html +20 -17
  30. package/SVF-doxygen/html/html/functions_p.html +12 -14
  31. package/SVF-doxygen/html/html/functions_r.html +7 -5
  32. package/SVF-doxygen/html/html/functions_s.html +22 -23
  33. package/SVF-doxygen/html/html/functions_t.html +7 -5
  34. package/SVF-doxygen/html/html/functions_v.html +6 -6
  35. package/SVF-doxygen/html/html/functions_vars_a.html +0 -3
  36. package/SVF-doxygen/html/html/functions_vars_o.html +7 -4
  37. package/SVF-doxygen/html/html/search/all_1.js +0 -1
  38. package/SVF-doxygen/html/html/search/all_10.js +10 -10
  39. package/SVF-doxygen/html/html/search/all_11.js +2 -2
  40. package/SVF-doxygen/html/html/search/all_12.js +7 -8
  41. package/SVF-doxygen/html/html/search/all_13.js +2 -2
  42. package/SVF-doxygen/html/html/search/all_14.js +1 -1
  43. package/SVF-doxygen/html/html/search/all_15.js +3 -3
  44. package/SVF-doxygen/html/html/search/all_16.js +1 -1
  45. package/SVF-doxygen/html/html/search/all_3.js +1 -1
  46. package/SVF-doxygen/html/html/search/all_5.js +0 -11
  47. package/SVF-doxygen/html/html/search/all_6.js +1 -1
  48. package/SVF-doxygen/html/html/search/all_7.js +5 -4
  49. package/SVF-doxygen/html/html/search/all_9.js +2 -2
  50. package/SVF-doxygen/html/html/search/all_c.js +3 -3
  51. package/SVF-doxygen/html/html/search/all_e.js +4 -4
  52. package/SVF-doxygen/html/html/search/all_f.js +6 -4
  53. package/SVF-doxygen/html/html/search/enums_3.js +0 -1
  54. package/SVF-doxygen/html/html/search/enumvalues_4.js +1 -11
  55. package/SVF-doxygen/html/html/search/functions_11.js +1 -2
  56. package/SVF-doxygen/html/html/search/functions_6.js +5 -4
  57. package/SVF-doxygen/html/html/search/functions_e.js +1 -1
  58. package/SVF-doxygen/html/html/search/functions_f.js +2 -2
  59. package/SVF-doxygen/html/html/search/variables_1.js +0 -1
  60. package/SVF-doxygen/html/html/search/variables_13.js +1 -1
  61. package/SVF-doxygen/html/html/search/variables_14.js +1 -1
  62. package/SVF-doxygen/html/html/search/variables_e.js +3 -3
  63. package/SVF-doxygen/html/html/search/variables_f.js +3 -2
  64. package/include/SVF-FE/SVFIRBuilder.h +1 -1
  65. package/include/Util/ExtAPI.h +17 -42
  66. package/include/Util/ExtAPI.json +1013 -989
  67. package/lib/SVF-FE/SVFIRBuilder.cpp +122 -222
  68. package/lib/Util/ExtAPI.cpp +53 -68
  69. package/lib/WPA/VersionedFlowSensitive.cpp +41 -15
  70. package/package.json +1 -1
@@ -123,15 +123,29 @@ void VersionedFlowSensitive::meldLabel(void)
123
123
 
124
124
  assert(Options::VersioningThreads > 0 && "VFS::meldLabel: number of versioning threads must be > 0!");
125
125
 
126
- // Nodes which have at least one object on them given a prelabel.
127
- std::vector<const SVFGNode *> prelabeledNodes;
126
+ // Nodes which have at least one object on them given a prelabel + the Andersen's points-to
127
+ // set of interest so we don't keep calling getPts. For Store nodes, we'll fill that in, for
128
+ // MR nodes, we won't as its getPointsTo is cheap.
129
+ // TODO: preferably we cache both for ease and to avoid the dyn_cast/isa, but Andersen's points-to
130
+ // sets are PointsTo and MR's sets are NodeBS, which are incompatible types. Maybe when we can
131
+ // use std::option.
132
+ std::vector<std::pair<const SVFGNode *, const PointsTo *>> prelabeledNodes;
128
133
  // Fast query for the above.
129
134
  std::vector<bool> isPrelabeled(svfg->getTotalNodeNum(), false);
130
135
  while (!vWorklist.empty())
131
136
  {
132
137
  const NodeID n = vWorklist.pop();
133
- prelabeledNodes.push_back(svfg->getSVFGNode(n));
134
138
  isPrelabeled[n] = true;
139
+
140
+ const SVFGNode *sn = svfg->getSVFGNode(n);
141
+ const PointsTo *nPts = nullptr;
142
+ if (const StoreSVFGNode *store = SVFUtil::dyn_cast<StoreSVFGNode>(sn))
143
+ {
144
+ const NodeID p = store->getPAGDstNodeID();
145
+ nPts = &(this->ander->getPts(p));
146
+ }
147
+
148
+ prelabeledNodes.push_back(std::make_pair(sn, nPts));
135
149
  }
136
150
 
137
151
  // Delta, delta source, store, and load nodes, which require versions during
@@ -180,20 +194,21 @@ void VersionedFlowSensitive::meldLabel(void)
180
194
  // For starting nodes, we only need those which did prelabeling for o specifically.
181
195
  // TODO: maybe we should move this to prelabel with a map (o -> starting nodes).
182
196
  std::vector<const SVFGNode *> osStartingNodes;
183
- for (const SVFGNode *sn : prelabeledNodes)
197
+ for (std::pair<const SVFGNode *, const PointsTo *> snPts : prelabeledNodes)
184
198
  {
185
- if (const StoreSVFGNode *store = SVFUtil::dyn_cast<StoreSVFGNode>(sn))
199
+ const SVFGNode *sn = snPts.first;
200
+ const PointsTo *pts = snPts.second;
201
+ if (pts != nullptr)
186
202
  {
187
- const NodeID p = store->getPAGDstNodeID();
188
- if (this->ander->getPts(p).test(o)) osStartingNodes.push_back(sn);
203
+ if (pts->test(o)) osStartingNodes.push_back(sn);
189
204
  }
190
- else if (delta(sn->getId()))
205
+ else if (const MRSVFGNode *mr = SVFUtil::dyn_cast<MRSVFGNode>(sn))
191
206
  {
192
- const MRSVFGNode *mr = SVFUtil::dyn_cast<MRSVFGNode>(sn);
193
- if (mr != nullptr)
194
- {
195
- if (mr->getPointsTo().test(o)) osStartingNodes.push_back(sn);
196
- }
207
+ if (mr->getPointsTo().test(o)) osStartingNodes.push_back(sn);
208
+ }
209
+ else
210
+ {
211
+ assert(false && "VFS::meldLabel: unexpected prelabeled node!");
197
212
  }
198
213
  }
199
214
 
@@ -234,10 +249,21 @@ void VersionedFlowSensitive::meldLabel(void)
234
249
  // SVFG nodes of interest -- those part of an SCC from the starting nodes.
235
250
  std::vector<NodeID> todoList;
236
251
  unsigned bit = 0;
237
- for (NodeID n = 0; n < partOf.size(); ++n)
252
+ // To calculate reachable nodes, we can see what nodes n exist where
253
+ // partOf[n] != -1. Since the SVFG can be large this can be expensive.
254
+ // Instead, we can gather this from the edges in the footprint and
255
+ // the starting nodes (incase such nodes have no edges).
256
+ // TODO: should be able to do this better: too many redundant inserts.
257
+ Set<NodeID> reachableNodes;
258
+ for (const SVFGNode *sn : osStartingNodes) reachableNodes.insert(sn->getId());
259
+ for (const SVFGEdge *se : footprint)
238
260
  {
239
- if (partOf[n] == -1) continue;
261
+ reachableNodes.insert(se->getSrcNode()->getId());
262
+ reachableNodes.insert(se->getDstNode()->getId());
263
+ }
240
264
 
265
+ for (const NodeID n : reachableNodes)
266
+ {
241
267
  if (isPrelabeled[n])
242
268
  {
243
269
  if (this->isStore(n)) storesYieldedMeldVersion[n].set(bit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.549",
3
+ "version": "1.0.552",
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": {