svf-tools 1.0.270 → 1.0.274

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 (126) hide show
  1. package/SVF-doxygen/html/html/ContextDDA_8h_source.html +1 -1
  2. package/SVF-doxygen/html/html/FlowDDA_8h_source.html +1 -1
  3. package/SVF-doxygen/html/html/MSSAMuChi_8h_source.html +118 -117
  4. package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +5 -5
  5. package/SVF-doxygen/html/html/MemSSA_8h_source.html +17 -17
  6. package/SVF-doxygen/html/html/SVFGEdge_8h_source.html +1 -1
  7. package/SVF-doxygen/html/html/SVFGNode_8h_source.html +88 -87
  8. package/SVF-doxygen/html/html/SVFGOPT_8cpp_source.html +5 -5
  9. package/SVF-doxygen/html/html/SVFGOPT_8h_source.html +8 -11
  10. package/SVF-doxygen/html/html/SVFG_8cpp.html +2 -0
  11. package/SVF-doxygen/html/html/SVFG_8cpp_source.html +87 -70
  12. package/SVF-doxygen/html/html/SVFG_8h_source.html +48 -54
  13. package/SVF-doxygen/html/html/VersionedFlowSensitive_8cpp_source.html +3 -3
  14. package/SVF-doxygen/html/html/classSVF_1_1ActualINSVFGNode-members.html +24 -24
  15. package/SVF-doxygen/html/html/classSVF_1_1ActualINSVFGNode.html +47 -48
  16. package/SVF-doxygen/html/html/classSVF_1_1ActualOUTSVFGNode-members.html +66 -66
  17. package/SVF-doxygen/html/html/classSVF_1_1ActualOUTSVFGNode.html +50 -52
  18. package/SVF-doxygen/html/html/classSVF_1_1ArgumentVFGNode.html +2 -2
  19. package/SVF-doxygen/html/html/classSVF_1_1BinaryOPVFGNode.html +2 -2
  20. package/SVF-doxygen/html/html/classSVF_1_1CallCHI.html +22 -22
  21. package/SVF-doxygen/html/html/classSVF_1_1CallIndSVFGEdge.html +2 -2
  22. package/SVF-doxygen/html/html/classSVF_1_1CallMU-members.html +2 -2
  23. package/SVF-doxygen/html/html/classSVF_1_1CallMU.html +22 -22
  24. package/SVF-doxygen/html/html/classSVF_1_1CmpVFGNode.html +2 -2
  25. package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +1 -1
  26. package/SVF-doxygen/html/html/classSVF_1_1DummyVersionPropSVFGNode.html +16 -16
  27. package/SVF-doxygen/html/html/classSVF_1_1EntryCHI.html +20 -20
  28. package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +1 -1
  29. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +2 -2
  30. package/SVF-doxygen/html/html/classSVF_1_1FormalINSVFGNode-members.html +64 -62
  31. package/SVF-doxygen/html/html/classSVF_1_1FormalINSVFGNode.html +94 -37
  32. package/SVF-doxygen/html/html/classSVF_1_1FormalOUTSVFGNode-members.html +29 -27
  33. package/SVF-doxygen/html/html/classSVF_1_1FormalOUTSVFGNode.html +94 -39
  34. package/SVF-doxygen/html/html/classSVF_1_1IndirectSVFGEdge.html +2 -2
  35. package/SVF-doxygen/html/html/classSVF_1_1InterMSSAPHISVFGNode-members.html +12 -12
  36. package/SVF-doxygen/html/html/classSVF_1_1InterMSSAPHISVFGNode.html +50 -49
  37. package/SVF-doxygen/html/html/classSVF_1_1IntraIndSVFGEdge.html +2 -2
  38. package/SVF-doxygen/html/html/classSVF_1_1IntraMSSAPHISVFGNode-members.html +49 -47
  39. package/SVF-doxygen/html/html/classSVF_1_1IntraMSSAPHISVFGNode.html +145 -30
  40. package/SVF-doxygen/html/html/classSVF_1_1LoadMU-members.html +2 -2
  41. package/SVF-doxygen/html/html/classSVF_1_1LoadMU.html +24 -24
  42. package/SVF-doxygen/html/html/classSVF_1_1MRSVFGNode.html +2 -2
  43. package/SVF-doxygen/html/html/classSVF_1_1MRVer-members.html +9 -8
  44. package/SVF-doxygen/html/html/classSVF_1_1MRVer.html +33 -0
  45. package/SVF-doxygen/html/html/classSVF_1_1MSSACHI.html +30 -30
  46. package/SVF-doxygen/html/html/classSVF_1_1MSSADEF.html +31 -31
  47. package/SVF-doxygen/html/html/classSVF_1_1MSSAMU-members.html +2 -2
  48. package/SVF-doxygen/html/html/classSVF_1_1MSSAMU.html +47 -47
  49. package/SVF-doxygen/html/html/classSVF_1_1MSSAPHI.html +38 -38
  50. package/SVF-doxygen/html/html/classSVF_1_1MSSAPHISVFGNode-members.html +12 -12
  51. package/SVF-doxygen/html/html/classSVF_1_1MSSAPHISVFGNode.html +53 -51
  52. package/SVF-doxygen/html/html/classSVF_1_1MTASVFGBuilder.html +2 -2
  53. package/SVF-doxygen/html/html/classSVF_1_1PHIVFGNode.html +2 -2
  54. package/SVF-doxygen/html/html/classSVF_1_1RetIndSVFGEdge.html +2 -2
  55. package/SVF-doxygen/html/html/classSVF_1_1RetMU-members.html +2 -2
  56. package/SVF-doxygen/html/html/classSVF_1_1RetMU.html +20 -20
  57. package/SVF-doxygen/html/html/classSVF_1_1SVFG-members.html +5 -5
  58. package/SVF-doxygen/html/html/classSVF_1_1SVFG.html +237 -136
  59. package/SVF-doxygen/html/html/classSVF_1_1SVFGBuilder.html +3 -3
  60. package/SVF-doxygen/html/html/classSVF_1_1SVFGOPT-members.html +5 -5
  61. package/SVF-doxygen/html/html/classSVF_1_1SVFGOPT.html +30 -30
  62. package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +2 -2
  63. package/SVF-doxygen/html/html/classSVF_1_1StmtVFGNode.html +2 -2
  64. package/SVF-doxygen/html/html/classSVF_1_1StoreCHI.html +24 -24
  65. package/SVF-doxygen/html/html/classSVF_1_1ThreadMHPIndSVFGEdge.html +2 -2
  66. package/SVF-doxygen/html/html/classSVF_1_1VFGNode.html +1 -1
  67. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +4 -4
  68. package/SVF-doxygen/html/html/functions_a.html +7 -7
  69. package/SVF-doxygen/html/html/functions_c.html +21 -25
  70. package/SVF-doxygen/html/html/functions_f.html +17 -11
  71. package/SVF-doxygen/html/html/functions_func.html +7 -7
  72. package/SVF-doxygen/html/html/functions_func_f.html +2 -2
  73. package/SVF-doxygen/html/html/functions_func_g.html +25 -25
  74. package/SVF-doxygen/html/html/functions_func_i.html +1 -1
  75. package/SVF-doxygen/html/html/functions_func_m.html +1 -1
  76. package/SVF-doxygen/html/html/functions_func_o.html +4 -2
  77. package/SVF-doxygen/html/html/functions_g.html +22 -22
  78. package/SVF-doxygen/html/html/functions_i.html +4 -4
  79. package/SVF-doxygen/html/html/functions_m.html +1 -5
  80. package/SVF-doxygen/html/html/functions_o.html +12 -12
  81. package/SVF-doxygen/html/html/functions_p.html +12 -14
  82. package/SVF-doxygen/html/html/functions_r.html +5 -9
  83. package/SVF-doxygen/html/html/functions_s.html +9 -7
  84. package/SVF-doxygen/html/html/functions_t.html +3 -3
  85. package/SVF-doxygen/html/html/functions_u.html +3 -3
  86. package/SVF-doxygen/html/html/functions_v.html +9 -4
  87. package/SVF-doxygen/html/html/functions_vars_c.html +0 -4
  88. package/SVF-doxygen/html/html/functions_vars_f.html +6 -0
  89. package/SVF-doxygen/html/html/functions_vars_m.html +0 -4
  90. package/SVF-doxygen/html/html/functions_vars_r.html +2 -2
  91. package/SVF-doxygen/html/html/functions_vars_v.html +6 -1
  92. package/SVF-doxygen/html/html/search/all_1.js +7 -7
  93. package/SVF-doxygen/html/html/search/all_10.js +8 -8
  94. package/SVF-doxygen/html/html/search/all_12.js +4 -4
  95. package/SVF-doxygen/html/html/search/all_13.js +5 -5
  96. package/SVF-doxygen/html/html/search/all_14.js +2 -2
  97. package/SVF-doxygen/html/html/search/all_15.js +1 -1
  98. package/SVF-doxygen/html/html/search/all_16.js +2 -2
  99. package/SVF-doxygen/html/html/search/all_3.js +1 -1
  100. package/SVF-doxygen/html/html/search/all_6.js +5 -3
  101. package/SVF-doxygen/html/html/search/all_7.js +6 -9
  102. package/SVF-doxygen/html/html/search/all_9.js +2 -2
  103. package/SVF-doxygen/html/html/search/all_d.js +4 -4
  104. package/SVF-doxygen/html/html/search/all_e.js +2 -2
  105. package/SVF-doxygen/html/html/search/all_f.js +3 -3
  106. package/SVF-doxygen/html/html/search/functions_0.js +7 -7
  107. package/SVF-doxygen/html/html/search/functions_10.js +1 -1
  108. package/SVF-doxygen/html/html/search/functions_5.js +2 -2
  109. package/SVF-doxygen/html/html/search/functions_6.js +6 -9
  110. package/SVF-doxygen/html/html/search/functions_8.js +1 -1
  111. package/SVF-doxygen/html/html/search/functions_b.js +1 -1
  112. package/SVF-doxygen/html/html/search/functions_d.js +2 -2
  113. package/SVF-doxygen/html/html/search/variables_12.js +2 -2
  114. package/SVF-doxygen/html/html/search/variables_16.js +1 -1
  115. package/SVF-doxygen/html/html/search/variables_3.js +0 -1
  116. package/SVF-doxygen/html/html/search/variables_6.js +2 -0
  117. package/SVF-doxygen/html/html/search/variables_d.js +2 -3
  118. package/SVF-doxygen/html/html/search/variables_e.js +1 -1
  119. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01SVFG_01_5_01_4.html +28 -28
  120. package/SVF-doxygen/html/html/structllvm_1_1GraphTraits_3_01SVF_1_1SVFG_01_5_01_4.html +2 -2
  121. package/include/Graphs/SVFG.h +28 -23
  122. package/include/Graphs/SVFGNode.h +69 -36
  123. package/include/Graphs/SVFGOPT.h +2 -2
  124. package/include/MSSA/MSSAMuChi.h +10 -4
  125. package/lib/Graphs/SVFG.cpp +52 -35
  126. package/package.json +1 -1
@@ -394,43 +394,48 @@ protected:
394
394
  }
395
395
 
396
396
  /// Add memory Function entry chi SVFG node
397
- inline void addFormalINSVFGNode(const MemSSA::ENTRYCHI* chi)
397
+ inline void addFormalINSVFGNode(const FunEntryBlockNode* funEntry, const MRVer* resVer, const NodeID nodeId)
398
398
  {
399
- FormalINSVFGNode* sNode = new FormalINSVFGNode(totalVFGNode++,chi);
400
- addSVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(chi->getFunction()));
401
- setDef(chi->getResVer(),sNode);
402
- funToFormalINMap[chi->getFunction()].set(sNode->getId());
399
+ FormalINSVFGNode* sNode = new FormalINSVFGNode(nodeId, resVer, funEntry);
400
+ addSVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(funEntry->getFun()));
401
+ setDef(resVer,sNode);
402
+ funToFormalINMap[funEntry->getFun()].set(sNode->getId());
403
403
  }
404
+
404
405
  /// Add memory Function return mu SVFG node
405
- inline void addFormalOUTSVFGNode(const MemSSA::RETMU* mu)
406
+ inline void addFormalOUTSVFGNode(const FunExitBlockNode* funExit, const MRVer* ver, const NodeID nodeId)
406
407
  {
407
- FormalOUTSVFGNode* sNode = new FormalOUTSVFGNode(totalVFGNode++,mu);
408
- addSVFGNode(sNode,pag->getICFG()->getFunExitBlockNode(mu->getFunction()));
409
- funToFormalOUTMap[mu->getFunction()].set(sNode->getId());
408
+ FormalOUTSVFGNode* sNode = new FormalOUTSVFGNode(nodeId, ver, funExit);
409
+ addSVFGNode(sNode,pag->getICFG()->getFunExitBlockNode(funExit->getFun()));
410
+ funToFormalOUTMap[funExit->getFun()].set(sNode->getId());
410
411
  }
412
+
411
413
  /// Add memory callsite mu SVFG node
412
- inline void addActualINSVFGNode(const MemSSA::CALLMU* mu)
414
+ inline void addActualINSVFGNode(const CallBlockNode* callsite, const MRVer* ver, const NodeID nodeId)
413
415
  {
414
- ActualINSVFGNode* sNode = new ActualINSVFGNode(totalVFGNode++,mu, mu->getCallSite());
415
- addSVFGNode(sNode,pag->getICFG()->getCallBlockNode(mu->getCallSite()->getCallSite()));
416
- callSiteToActualINMap[mu->getCallSite()].set(sNode->getId());
416
+ ActualINSVFGNode* sNode = new ActualINSVFGNode(nodeId, callsite, ver);
417
+ addSVFGNode(sNode,pag->getICFG()->getCallBlockNode(callsite->getCallSite()));
418
+ callSiteToActualINMap[callsite].set(sNode->getId());
417
419
  }
420
+
418
421
  /// Add memory callsite chi SVFG node
419
- inline void addActualOUTSVFGNode(const MemSSA::CALLCHI* chi)
422
+ inline void addActualOUTSVFGNode(const CallBlockNode* callsite, const MRVer* resVer, const NodeID nodeId)
420
423
  {
421
- ActualOUTSVFGNode* sNode = new ActualOUTSVFGNode(totalVFGNode++,chi,chi->getCallSite());
422
- addSVFGNode(sNode, pag->getICFG()->getRetBlockNode(chi->getCallSite()->getCallSite()));
423
- setDef(chi->getResVer(),sNode);
424
- callSiteToActualOUTMap[chi->getCallSite()].set(sNode->getId());
424
+ ActualOUTSVFGNode* sNode = new ActualOUTSVFGNode(nodeId, callsite, resVer);
425
+ addSVFGNode(sNode, pag->getICFG()->getRetBlockNode(callsite->getCallSite()));
426
+ setDef(resVer,sNode);
427
+ callSiteToActualOUTMap[callsite].set(sNode->getId());
425
428
  }
429
+
426
430
  /// Add memory SSA PHI SVFG node
427
- inline void addIntraMSSAPHISVFGNode(const MemSSA::PHI* phi)
431
+ inline void addIntraMSSAPHISVFGNode(ICFGNode* BlockICFGNode, const Map<u32_t,const MRVer*>::const_iterator opVerBegin,
432
+ const Map<u32_t,const MRVer*>::const_iterator opVerEnd, const MRVer* resVer, const NodeID nodeId)
428
433
  {
429
- IntraMSSAPHISVFGNode* sNode = new IntraMSSAPHISVFGNode(totalVFGNode++,phi);
430
- addSVFGNode(sNode, pag->getICFG()->getBlockICFGNode(&(phi->getBasicBlock()->front())));
431
- for(MemSSA::PHI::OPVers::const_iterator it = phi->opVerBegin(), eit=phi->opVerEnd(); it!=eit; ++it)
434
+ IntraMSSAPHISVFGNode* sNode = new IntraMSSAPHISVFGNode(nodeId, resVer);
435
+ addSVFGNode(sNode, BlockICFGNode);
436
+ for(MemSSA::PHI::OPVers::const_iterator it = opVerBegin, eit=opVerEnd; it!=eit; ++it)
432
437
  sNode->setOpVer(it->first,it->second);
433
- setDef(phi->getResVer(),sNode);
438
+ setDef(resVer,sNode);
434
439
  }
435
440
 
436
441
  /// Has function for EntryCHI/RetMU/CallCHI/CallMU
@@ -90,18 +90,24 @@ public:
90
90
  class FormalINSVFGNode : public MRSVFGNode
91
91
  {
92
92
  private:
93
- const MemSSA::ENTRYCHI* chi;
93
+ const MRVer* ver;
94
+ const FunEntryBlockNode* funEntryNode;
94
95
 
95
96
  public:
96
97
  /// Constructor
97
- FormalINSVFGNode(NodeID id, const MemSSA::ENTRYCHI* entry): MRSVFGNode(id, FPIN), chi(entry)
98
+ FormalINSVFGNode(NodeID id, const MRVer* resVer, const FunEntryBlockNode* funEntry): MRSVFGNode(id, FPIN)
98
99
  {
99
- cpts = entry->getMR()->getPointsTo();
100
+ cpts = resVer->getMR()->getPointsTo();
101
+ ver = resVer;
102
+ funEntryNode = funEntry;
100
103
  }
101
- /// EntryCHI
102
- inline const MemSSA::ENTRYCHI* getEntryChi() const
104
+ inline const MRVer* getMRVer() const
103
105
  {
104
- return chi;
106
+ return ver;
107
+ }
108
+ inline const FunEntryBlockNode* getFunEntryNode() const
109
+ {
110
+ return funEntryNode;
105
111
  }
106
112
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
107
113
  //@{
@@ -129,16 +135,21 @@ public:
129
135
  class FormalOUTSVFGNode : public MRSVFGNode
130
136
  {
131
137
  private:
132
- const MemSSA::RETMU* mu;
138
+ const MRVer* ver;
139
+ const FunExitBlockNode* funExitNode;
133
140
 
134
141
  public:
135
142
  /// Constructor
136
- FormalOUTSVFGNode(NodeID id, const MemSSA::RETMU* exit);
143
+ FormalOUTSVFGNode(NodeID id, const MRVer* ver, const FunExitBlockNode* funExitNode);
137
144
 
138
- /// RetMU
139
- inline const MemSSA::RETMU* getRetMU() const
145
+ inline const FunExitBlockNode* getFunExitNode() const
140
146
  {
141
- return mu;
147
+ return funExitNode;
148
+ }
149
+
150
+ inline const MRVer* getMRVer() const
151
+ {
152
+ return ver;
142
153
  }
143
154
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
144
155
  //@{
@@ -166,26 +177,29 @@ public:
166
177
  class ActualINSVFGNode : public MRSVFGNode
167
178
  {
168
179
  private:
169
- const MemSSA::CALLMU* mu;
170
180
  const CallBlockNode* cs;
181
+ const MRVer* ver;
171
182
  public:
172
183
  /// Constructor
173
- ActualINSVFGNode(NodeID id, const MemSSA::CALLMU* m, const CallBlockNode* c):
174
- MRSVFGNode(id, APIN), mu(m), cs(c)
184
+ ActualINSVFGNode(NodeID id, const CallBlockNode* c, const MRVer* mrver):
185
+ MRSVFGNode(id, APIN), cs(c)
175
186
  {
176
- cpts = m->getMR()->getPointsTo();
187
+ cpts = mrver->getMR()->getPointsTo();
188
+ ver = mrver;
177
189
  }
178
190
  /// Callsite
179
191
  inline const CallBlockNode* getCallSite() const
180
192
  {
181
193
  return cs;
182
194
  }
183
- /// CallMU
184
- inline const MemSSA::CALLMU* getCallMU() const
195
+
196
+ /// Ver
197
+ inline const MRVer* getMRVer() const
185
198
  {
186
- return mu;
199
+ return ver;
187
200
  }
188
201
 
202
+
189
203
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
190
204
  //@{
191
205
  static inline bool classof(const ActualINSVFGNode *)
@@ -212,27 +226,27 @@ public:
212
226
  class ActualOUTSVFGNode : public MRSVFGNode
213
227
  {
214
228
  private:
215
- const MemSSA::CALLCHI* chi;
216
229
  const CallBlockNode* cs;
230
+ const MRVer* ver;
217
231
 
218
232
  public:
219
233
  /// Constructor
220
- ActualOUTSVFGNode(NodeID id, const MemSSA::CALLCHI* c, const CallBlockNode* cal):
221
- MRSVFGNode(id, APOUT), chi(c), cs(cal)
234
+ ActualOUTSVFGNode(NodeID id, const CallBlockNode* cal, const MRVer* resVer):
235
+ MRSVFGNode(id, APOUT), cs(cal)
222
236
  {
223
- cpts = c->getMR()->getPointsTo();
237
+ cpts = resVer->getMR()->getPointsTo();
238
+ ver = resVer;
224
239
  }
225
240
  /// Callsite
226
241
  inline const CallBlockNode* getCallSite() const
227
242
  {
228
243
  return cs;
229
244
  }
230
- /// CallCHI
231
- inline const MemSSA::CALLCHI* getCallCHI() const
245
+ /// Ver
246
+ inline const MRVer* getMRVer() const
232
247
  {
233
- return chi;
248
+ return ver;
234
249
  }
235
-
236
250
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
237
251
  //@{
238
252
  static inline bool classof(const ActualOUTSVFGNode *)
@@ -262,14 +276,20 @@ public:
262
276
  typedef Map<u32_t,const MRVer*> OPVers;
263
277
 
264
278
  protected:
265
- const MemSSA::MDEF* res;
279
+ const MRVer* ver;
266
280
  OPVers opVers;
267
281
 
268
282
  public:
269
283
  /// Constructor
270
- MSSAPHISVFGNode(NodeID id, const MemSSA::MDEF* def,VFGNodeK k = MPhi): MRSVFGNode(id, k), res(def)
284
+ MSSAPHISVFGNode(NodeID id, const MRVer* resVer,VFGNodeK k = MPhi): MRSVFGNode(id, k)
285
+ {
286
+ cpts = resVer->getMR()->getPointsTo();
287
+ ver = resVer;
288
+ }
289
+ /// Ver
290
+ inline const MRVer* getResVer() const
271
291
  {
272
- cpts = def->getMR()->getPointsTo();
292
+ return ver;
273
293
  }
274
294
  /// MSSA phi operands
275
295
  //@{
@@ -283,10 +303,6 @@ public:
283
303
  {
284
304
  opVers[pos] = node;
285
305
  }
286
- inline const MemSSA::MDEF* getRes() const
287
- {
288
- return res;
289
- }
290
306
  inline u32_t getOpVerNum() const
291
307
  {
292
308
  return opVers.size();
@@ -331,9 +347,26 @@ class IntraMSSAPHISVFGNode : public MSSAPHISVFGNode
331
347
  {
332
348
 
333
349
  public:
350
+ const MRVer* resVer;
334
351
  /// Constructor
335
- IntraMSSAPHISVFGNode(NodeID id, const MemSSA::PHI* phi): MSSAPHISVFGNode(id, phi, MIntraPhi)
352
+ IntraMSSAPHISVFGNode(NodeID id, const MRVer* resVer): MSSAPHISVFGNode(id, resVer, MIntraPhi)
336
353
  {
354
+ resVer = resVer;
355
+ }
356
+
357
+ inline const MRVer* getMRVer() const
358
+ {
359
+ return resVer;
360
+ }
361
+
362
+ inline OPVers::const_iterator opVerBegin() const
363
+ {
364
+ return opVers.begin();
365
+ }
366
+
367
+ inline OPVers::const_iterator opVerEnd() const
368
+ {
369
+ return opVers.end();
337
370
  }
338
371
 
339
372
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -372,9 +405,9 @@ class InterMSSAPHISVFGNode : public MSSAPHISVFGNode
372
405
 
373
406
  public:
374
407
  /// Constructor interPHI for formal parameter
375
- InterMSSAPHISVFGNode(NodeID id, const FormalINSVFGNode* fi) : MSSAPHISVFGNode(id, fi->getEntryChi(), MInterPhi),fun(fi->getFun()),callInst(nullptr) {}
408
+ InterMSSAPHISVFGNode(NodeID id, const FormalINSVFGNode* fi) : MSSAPHISVFGNode(id, fi->getMRVer(), MInterPhi),fun(fi->getFun()),callInst(nullptr) {}
376
409
  /// Constructor interPHI for actual return
377
- InterMSSAPHISVFGNode(NodeID id, const ActualOUTSVFGNode* ao) : MSSAPHISVFGNode(id, ao->getCallCHI(), MInterPhi), fun(nullptr),callInst(ao->getCallSite()) {}
410
+ InterMSSAPHISVFGNode(NodeID id, const ActualOUTSVFGNode* ao) : MSSAPHISVFGNode(id, ao->getMRVer(), MInterPhi), fun(nullptr),callInst(ao->getCallSite()) {}
378
411
 
379
412
  inline bool isFormalINPHI() const
380
413
  {
@@ -296,11 +296,11 @@ private:
296
296
  //@{
297
297
  inline bool formalInOfAddressTakenFunc(const FormalINSVFGNode* fi) const
298
298
  {
299
- return (fi->getEntryChi()->getFunction()->getLLVMFun()->hasAddressTaken());
299
+ return (fi->getFun()->getLLVMFun()->hasAddressTaken());
300
300
  }
301
301
  inline bool formalOutOfAddressTakenFunc(const FormalOUTSVFGNode* fo) const
302
302
  {
303
- return (fo->getRetMU()->getFunction()->getLLVMFun()->hasAddressTaken());
303
+ return (fo->getFun()->getLLVMFun()->hasAddressTaken());
304
304
  }
305
305
  //@}
306
306
 
@@ -76,6 +76,12 @@ public:
76
76
  {
77
77
  return def;
78
78
  }
79
+
80
+ /// Get MRVERID
81
+ inline MRVERID getID() const
82
+ {
83
+ return vid;
84
+ }
79
85
  };
80
86
 
81
87
 
@@ -128,7 +134,7 @@ public:
128
134
  ver = v;
129
135
  }
130
136
  /// Get Ver
131
- inline MRVer* getVer() const
137
+ inline MRVer* getMRVer() const
132
138
  {
133
139
  assert(ver!=nullptr && "version is nullptr, did not rename?");
134
140
  return ver;
@@ -203,7 +209,7 @@ public:
203
209
  /// Print MU
204
210
  virtual void dump()
205
211
  {
206
- SVFUtil::outs() << "LDMU(MR_" << this->getMR()->getMRID() << "V_" << this->getVer()->getSSAVersion() << ") \t" <<
212
+ SVFUtil::outs() << "LDMU(MR_" << this->getMR()->getMRID() << "V_" << this->getMRVer()->getSSAVersion() << ") \t" <<
207
213
  this->getMR()->dumpStr() << "\n";
208
214
  }
209
215
  };
@@ -258,7 +264,7 @@ public:
258
264
  /// Print MU
259
265
  virtual void dump()
260
266
  {
261
- SVFUtil::outs() << "CALMU(MR_" << this->getMR()->getMRID() << "V_" << this->getVer()->getSSAVersion() << ") \t" <<
267
+ SVFUtil::outs() << "CALMU(MR_" << this->getMR()->getMRID() << "V_" << this->getMRVer()->getSSAVersion() << ") \t" <<
262
268
  this->getMR()->dumpStr() << "\n";
263
269
  }
264
270
  };
@@ -303,7 +309,7 @@ public:
303
309
  /// Print MU
304
310
  virtual void dump()
305
311
  {
306
- SVFUtil::outs() << "RETMU(MR_" << this->getMR()->getMRID() << "V_" << this->getVer()->getSSAVersion() << ") \t" <<
312
+ SVFUtil::outs() << "RETMU(MR_" << this->getMR()->getMRID() << "V_" << this->getMRVer()->getSSAVersion() << ") \t" <<
307
313
  this->getMR()->dumpStr() << "\n";
308
314
  }
309
315
  };
@@ -32,10 +32,14 @@
32
32
  #include "Graphs/SVFG.h"
33
33
  #include "Graphs/SVFGOPT.h"
34
34
  #include "Graphs/SVFGStat.h"
35
+ #include "Graphs/ICFG.h"
36
+ #include <fstream>
37
+
35
38
 
36
39
  using namespace SVF;
37
40
  using namespace SVFUtil;
38
41
 
42
+
39
43
  const std::string MRSVFGNode::toString() const {
40
44
  std::string str;
41
45
  raw_string_ostream rawstr(str);
@@ -47,9 +51,9 @@ const std::string FormalINSVFGNode::toString() const {
47
51
  std::string str;
48
52
  raw_string_ostream rawstr(str);
49
53
  rawstr << "FormalINSVFGNode ID: " << getId() << " {fun: " << getFun()->getName() << "}";
50
- rawstr << getEntryChi()->getMR()->getMRID() << "V_" << getEntryChi()->getResVer()->getSSAVersion() <<
51
- " = ENCHI(MR_" << getEntryChi()->getMR()->getMRID() << "V_" << getEntryChi()->getOpVer()->getSSAVersion() << ")\n";
52
- rawstr << getEntryChi()->getMR()->dumpStr() << "\n";
54
+ rawstr << getMRVer()->getMR()->getMRID() << "V_" << getMRVer()->getSSAVersion() <<
55
+ " = ENCHI(MR_" << getMRVer()->getMR()->getMRID() << "V_" << getMRVer()->getSSAVersion() << ")\n";
56
+ rawstr << getMRVer()->getMR()->dumpStr() << "\n";
53
57
  return rawstr.str();
54
58
  }
55
59
 
@@ -57,8 +61,8 @@ const std::string FormalOUTSVFGNode::toString() const {
57
61
  std::string str;
58
62
  raw_string_ostream rawstr(str);
59
63
  rawstr << "FormalOUTSVFGNode ID: " << getId() << " {fun: " << getFun()->getName() << "}";
60
- rawstr << "RETMU(" << getRetMU()->getMR()->getMRID() << "V_" << getRetMU()->getVer()->getSSAVersion() << ")\n";
61
- rawstr << getRetMU()->getMR()->dumpStr() << "\n";
64
+ rawstr << "RETMU(" << getMRVer()->getMR()->getMRID() << "V_" << getMRVer()->getSSAVersion() << ")\n";
65
+ rawstr << getMRVer()->getMR()->dumpStr() << "\n";
62
66
  return rawstr.str();
63
67
  }
64
68
 
@@ -66,8 +70,8 @@ const std::string ActualINSVFGNode::toString() const {
66
70
  std::string str;
67
71
  raw_string_ostream rawstr(str);
68
72
  rawstr << "ActualINSVFGNode ID: " << getId() << " at callsite: " << *getCallSite()->getCallSite() << " {fun: " << getFun()->getName() << "}";
69
- rawstr << "CSMU(" << getCallMU()->getMR()->getMRID() << "V_" << getCallMU()->getVer()->getSSAVersion() << ")\n";
70
- rawstr << getCallMU()->getMR()->dumpStr() << "\n";
73
+ rawstr << "CSMU(" << getMRVer()->getMR()->getMRID() << "V_" << getMRVer()->getSSAVersion() << ")\n";
74
+ rawstr << getMRVer()->getMR()->dumpStr() << "\n";
71
75
  rawstr << "CS[" << getSourceLoc(getCallSite()->getCallSite()) << "]";
72
76
  return rawstr.str();
73
77
  }
@@ -76,9 +80,9 @@ const std::string ActualOUTSVFGNode::toString() const {
76
80
  std::string str;
77
81
  raw_string_ostream rawstr(str);
78
82
  rawstr << "ActualOUTSVFGNode ID: " << getId() << " at callsite: " << *getCallSite()->getCallSite() << " {fun: " << getFun()->getName() << "}";
79
- rawstr << getCallCHI()->getMR()->getMRID() << "V_" << getCallCHI()->getResVer()->getSSAVersion() <<
80
- " = CSCHI(MR_" << getCallCHI()->getMR()->getMRID() << "V_" << getCallCHI()->getOpVer()->getSSAVersion() << ")\n";
81
- rawstr << getCallCHI()->getMR()->dumpStr() << "\n";
83
+ rawstr << getMRVer()->getMR()->getMRID() << "V_" << getMRVer()->getSSAVersion() <<
84
+ " = CSCHI(MR_" << getMRVer()->getMR()->getMRID() << "V_" << getMRVer()->getSSAVersion() << ")\n";
85
+ rawstr << getMRVer()->getMR()->dumpStr() << "\n";
82
86
  rawstr << "CS[" << getSourceLoc(getCallSite()->getCallSite()) << "]" ;
83
87
  return rawstr.str();
84
88
  }
@@ -87,14 +91,14 @@ const std::string MSSAPHISVFGNode::toString() const {
87
91
  std::string str;
88
92
  raw_string_ostream rawstr(str);
89
93
  rawstr << "MSSAPHISVFGNode ID: " << getId() << " {fun: " << getFun()->getName() << "}";
90
- rawstr << "MR_" << getRes()->getMR()->getMRID()
91
- << "V_" << getRes()->getResVer()->getSSAVersion() << " = PHI(";
94
+ rawstr << "MR_" << getResVer()->getMR()->getMRID()
95
+ << "V_" << getResVer()->getSSAVersion() << " = PHI(";
92
96
  for (MemSSA::PHI::OPVers::const_iterator it = opVerBegin(), eit = opVerEnd();
93
97
  it != eit; it++)
94
98
  rawstr << "MR_" << it->second->getMR()->getMRID() << "V_" << it->second->getSSAVersion() << ", ";
95
99
  rawstr << ")\n";
96
100
 
97
- rawstr << getRes()->getMR()->dumpStr();
101
+ rawstr << getResVer()->getMR()->dumpStr();
98
102
  rawstr << getSourceLoc(&getICFGNode()->getBB()->back());
99
103
  return rawstr.str();
100
104
  }
@@ -177,9 +181,11 @@ const Value* ArgumentVFGNode::getValue() const {
177
181
  }
178
182
 
179
183
 
180
- FormalOUTSVFGNode::FormalOUTSVFGNode(NodeID id, const MemSSA::RETMU* exit): MRSVFGNode(id, FPOUT), mu(exit)
184
+ FormalOUTSVFGNode::FormalOUTSVFGNode(NodeID id, const MRVer* mrVer, const FunExitBlockNode* funExit): MRSVFGNode(id, FPOUT)
181
185
  {
182
- cpts = exit->getMR()->getPointsTo();
186
+ cpts = mrVer->getMR()->getPointsTo();
187
+ ver = mrVer;
188
+ funExitNode = funExit;
183
189
  }
184
190
 
185
191
  /*!
@@ -226,7 +232,7 @@ void SVFG::buildSVFG()
226
232
  stat->indVFEdgeStart();
227
233
  connectIndirectSVFGEdges();
228
234
  stat->indVFEdgeEnd();
229
-
235
+
230
236
  }
231
237
 
232
238
  /*
@@ -252,38 +258,49 @@ void SVFG::addSVFGNodesForAddrTakenVars()
252
258
  for(MemSSA::BBToPhiSetMap::iterator it = mssa->getBBToPhiSetMap().begin(),
253
259
  eit = mssa->getBBToPhiSetMap().end(); it!=eit; ++it)
254
260
  {
255
- for(PHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi)
256
- addIntraMSSAPHISVFGNode(*pi);
261
+ for(PHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
262
+ MemSSA::PHI* phi = *pi;
263
+ addIntraMSSAPHISVFGNode(pag->getICFG()->getBlockICFGNode(&(phi->getBasicBlock()->front())), phi->opVerBegin(), phi->opVerEnd(),phi->getResVer(), totalVFGNode++);
264
+ }
257
265
  }
258
266
  /// initialize memory SSA entry chi nodes
259
267
  for(MemSSA::FunToEntryChiSetMap::iterator it = mssa->getFunToEntryChiSetMap().begin(),
260
268
  eit = mssa->getFunToEntryChiSetMap().end(); it!=eit; ++it)
261
269
  {
262
- for(CHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi)
263
- addFormalINSVFGNode(SVFUtil::cast<ENTRYCHI>(*pi));
270
+ for(CHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
271
+ const MemSSA::ENTRYCHI* chi = SVFUtil::cast<ENTRYCHI>(*pi);
272
+ addFormalINSVFGNode(pag->getICFG()->getFunEntryBlockNode(chi->getFunction()), chi->getResVer(), totalVFGNode++);
273
+ }
264
274
  }
265
275
  /// initialize memory SSA return mu nodes
266
276
  for(MemSSA::FunToReturnMuSetMap::iterator it = mssa->getFunToRetMuSetMap().begin(),
267
277
  eit = mssa->getFunToRetMuSetMap().end(); it!=eit; ++it)
268
278
  {
269
- for(MUSet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi)
270
- addFormalOUTSVFGNode(SVFUtil::cast<RETMU>(*pi));
279
+ for(MUSet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
280
+ const MemSSA::RETMU* mu = SVFUtil::cast<RETMU>(*pi);
281
+ addFormalOUTSVFGNode(pag->getICFG()->getFunExitBlockNode(mu->getFunction()), mu->getMRVer(), totalVFGNode++);
282
+ }
271
283
  }
272
284
  /// initialize memory SSA callsite mu nodes
273
285
  for(MemSSA::CallSiteToMUSetMap::iterator it = mssa->getCallSiteToMuSetMap().begin(),
274
286
  eit = mssa->getCallSiteToMuSetMap().end();
275
287
  it!=eit; ++it)
276
288
  {
277
- for(MUSet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi)
278
- addActualINSVFGNode(SVFUtil::cast<CALLMU>(*pi));
289
+ for(MUSet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
290
+ const MemSSA::CALLMU* mu = SVFUtil::cast<CALLMU>(*pi);
291
+ addActualINSVFGNode(mu->getCallSite(), mu->getMRVer(), totalVFGNode++);
292
+ }
279
293
  }
280
294
  /// initialize memory SSA callsite chi nodes
281
295
  for(MemSSA::CallSiteToCHISetMap::iterator it = mssa->getCallSiteToChiSetMap().begin(),
282
296
  eit = mssa->getCallSiteToChiSetMap().end();
283
297
  it!=eit; ++it)
284
298
  {
285
- for(CHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi)
286
- addActualOUTSVFGNode(SVFUtil::cast<CALLCHI>(*pi));
299
+ for(CHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
300
+ const MemSSA::CALLCHI* chi = SVFUtil::cast<CALLCHI>(*pi);
301
+ addActualOUTSVFGNode(chi->getCallSite(), chi->getResVer(), totalVFGNode++);
302
+ }
303
+
287
304
  }
288
305
  }
289
306
 
@@ -304,8 +321,8 @@ void SVFG::connectIndirectSVFGEdges()
304
321
  {
305
322
  if(LOADMU* mu = SVFUtil::dyn_cast<LOADMU>(*it))
306
323
  {
307
- NodeID def = getDef(mu->getVer());
308
- addIntraIndirectVFEdge(def,nodeId, mu->getVer()->getMR()->getPointsTo());
324
+ NodeID def = getDef(mu->getMRVer());
325
+ addIntraIndirectVFEdge(def,nodeId, mu->getMRVer()->getMR()->getPointsTo());
309
326
  }
310
327
  }
311
328
  }
@@ -324,7 +341,7 @@ void SVFG::connectIndirectSVFGEdges()
324
341
  else if(const FormalINSVFGNode* formalIn = SVFUtil::dyn_cast<FormalINSVFGNode>(node))
325
342
  {
326
343
  PTACallGraphEdge::CallInstSet callInstSet;
327
- mssa->getPTA()->getPTACallGraph()->getDirCallSitesInvokingCallee(formalIn->getEntryChi()->getFunction(),callInstSet);
344
+ mssa->getPTA()->getPTACallGraph()->getDirCallSitesInvokingCallee(formalIn->getFun(),callInstSet);
328
345
  for(PTACallGraphEdge::CallInstSet::iterator it = callInstSet.begin(), eit = callInstSet.end(); it!=eit; ++it)
329
346
  {
330
347
  const CallBlockNode* cs = *it;
@@ -341,8 +358,8 @@ void SVFG::connectIndirectSVFGEdges()
341
358
  else if(const FormalOUTSVFGNode* formalOut = SVFUtil::dyn_cast<FormalOUTSVFGNode>(node))
342
359
  {
343
360
  PTACallGraphEdge::CallInstSet callInstSet;
344
- const MemSSA::RETMU* retMu = formalOut->getRetMU();
345
- mssa->getPTA()->getPTACallGraph()->getDirCallSitesInvokingCallee(retMu->getFunction(),callInstSet);
361
+ // const MemSSA::RETMU* retMu = formalOut->getRetMU();
362
+ mssa->getPTA()->getPTACallGraph()->getDirCallSitesInvokingCallee(formalOut->getFun(),callInstSet);
346
363
  for(PTACallGraphEdge::CallInstSet::iterator it = callInstSet.begin(), eit = callInstSet.end(); it!=eit; ++it)
347
364
  {
348
365
  const CallBlockNode* cs = *it;
@@ -355,12 +372,12 @@ void SVFG::connectIndirectSVFGEdges()
355
372
  addInterIndirectVFRetEdge(formalOut,actualOut,getCallSiteID(cs, formalOut->getFun()));
356
373
  }
357
374
  }
358
- NodeID def = getDef(retMu->getVer());
359
- addIntraIndirectVFEdge(def,nodeId, retMu->getVer()->getMR()->getPointsTo());
375
+ NodeID def = getDef(formalOut->getMRVer());
376
+ addIntraIndirectVFEdge(def,nodeId, formalOut->getMRVer()->getMR()->getPointsTo());
360
377
  }
361
378
  else if(const ActualINSVFGNode* actualIn = SVFUtil::dyn_cast<ActualINSVFGNode>(node))
362
379
  {
363
- const MRVer* ver = actualIn->getCallMU()->getVer();
380
+ const MRVer* ver = actualIn->getMRVer();
364
381
  NodeID def = getDef(ver);
365
382
  addIntraIndirectVFEdge(def,nodeId, ver->getMR()->getPointsTo());
366
383
  }
@@ -706,7 +723,7 @@ const SVFFunction* SVFG::isFunEntrySVFGNode(const SVFGNode* node) const
706
723
  else if(const InterMSSAPHISVFGNode* mphi = SVFUtil::dyn_cast<InterMSSAPHISVFGNode>(node))
707
724
  {
708
725
  if(mphi->isFormalINPHI())
709
- return mphi->getFun();
726
+ return phi->getFun();
710
727
  }
711
728
  return nullptr;
712
729
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.270",
3
+ "version": "1.0.274",
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": {