svf-tools 1.0.357 → 1.0.358

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 (114) hide show
  1. package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +2 -2
  2. package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +1 -1
  3. package/SVF-doxygen/html/html/ConsG_8h_source.html +2 -2
  4. package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +3 -3
  5. package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +6 -6
  6. package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
  7. package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
  8. package/SVF-doxygen/html/html/IRGraph_8h_source.html +2 -2
  9. package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +12 -12
  10. package/SVF-doxygen/html/html/LocationSet_8h_source.html +1 -1
  11. package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +6 -6
  12. package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +1 -1
  13. package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +15 -15
  14. package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +2 -2
  15. package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +6 -6
  16. package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +5 -5
  17. package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +1 -1
  18. package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +7 -7
  19. package/SVF-doxygen/html/html/SVFIR_8h_source.html +5 -5
  20. package/SVF-doxygen/html/html/SVFModule_8cpp_source.html +1 -1
  21. package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +1 -1
  22. package/SVF-doxygen/html/html/SVFStatements_8h_source.html +1 -1
  23. package/SVF-doxygen/html/html/SVFVariables_8h_source.html +5 -5
  24. package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +1 -1
  25. package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +22 -22
  26. package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +1 -1
  27. package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +52 -50
  28. package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +86 -83
  29. package/SVF-doxygen/html/html/ThreadCallGraph_8cpp_source.html +3 -3
  30. package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +3 -3
  31. package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +1 -1
  32. package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
  33. package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +2 -2
  34. package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +2 -2
  35. package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +2 -2
  36. package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +1 -1
  37. package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +3 -3
  38. package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +1 -1
  39. package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +2 -2
  40. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +1 -1
  41. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +3 -3
  42. package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +4 -4
  43. package/SVF-doxygen/html/html/classSVF_1_1GepStmt.html +1 -1
  44. package/SVF-doxygen/html/html/classSVF_1_1IRGraph.html +1 -1
  45. package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +27 -29
  46. package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +7 -7
  47. package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +87 -87
  48. package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +99 -99
  49. package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +1 -1
  50. package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +1 -1
  51. package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +16 -16
  52. package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +9 -9
  53. package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +16 -16
  54. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +11 -11
  55. package/SVF-doxygen/html/html/classSVF_1_1SVFModule.html +1 -1
  56. package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +1 -1
  57. package/SVF-doxygen/html/html/classSVF_1_1StInfo-members.html +20 -15
  58. package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +239 -89
  59. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +35 -35
  60. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +6 -4
  61. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +178 -130
  62. package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +3 -3
  63. package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +4 -4
  64. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +3 -3
  65. package/SVF-doxygen/html/html/functions_a.html +1 -1
  66. package/SVF-doxygen/html/html/functions_e.html +3 -0
  67. package/SVF-doxygen/html/html/functions_f.html +12 -17
  68. package/SVF-doxygen/html/html/functions_func.html +1 -1
  69. package/SVF-doxygen/html/html/functions_func_g.html +21 -13
  70. package/SVF-doxygen/html/html/functions_func_s.html +8 -5
  71. package/SVF-doxygen/html/html/functions_g.html +20 -12
  72. package/SVF-doxygen/html/html/functions_i.html +3 -3
  73. package/SVF-doxygen/html/html/functions_l.html +3 -3
  74. package/SVF-doxygen/html/html/functions_m.html +1 -1
  75. package/SVF-doxygen/html/html/functions_n.html +9 -3
  76. package/SVF-doxygen/html/html/functions_o.html +11 -11
  77. package/SVF-doxygen/html/html/functions_p.html +10 -10
  78. package/SVF-doxygen/html/html/functions_r.html +2 -4
  79. package/SVF-doxygen/html/html/functions_s.html +23 -22
  80. package/SVF-doxygen/html/html/functions_t.html +3 -3
  81. package/SVF-doxygen/html/html/functions_v.html +6 -6
  82. package/SVF-doxygen/html/html/functions_vars_e.html +3 -0
  83. package/SVF-doxygen/html/html/functions_vars_f.html +0 -3
  84. package/SVF-doxygen/html/html/functions_vars_n.html +6 -0
  85. package/SVF-doxygen/html/html/functions_w.html +5 -9
  86. package/SVF-doxygen/html/html/search/all_1.js +1 -1
  87. package/SVF-doxygen/html/html/search/all_10.js +7 -7
  88. package/SVF-doxygen/html/html/search/all_12.js +2 -2
  89. package/SVF-doxygen/html/html/search/all_13.js +11 -10
  90. package/SVF-doxygen/html/html/search/all_14.js +4 -4
  91. package/SVF-doxygen/html/html/search/all_15.js +1 -1
  92. package/SVF-doxygen/html/html/search/all_16.js +3 -3
  93. package/SVF-doxygen/html/html/search/all_17.js +1 -1
  94. package/SVF-doxygen/html/html/search/all_5.js +1 -0
  95. package/SVF-doxygen/html/html/search/all_6.js +1 -2
  96. package/SVF-doxygen/html/html/search/all_7.js +6 -4
  97. package/SVF-doxygen/html/html/search/all_9.js +1 -1
  98. package/SVF-doxygen/html/html/search/all_c.js +1 -1
  99. package/SVF-doxygen/html/html/search/all_d.js +2 -2
  100. package/SVF-doxygen/html/html/search/all_e.js +5 -3
  101. package/SVF-doxygen/html/html/search/all_f.js +1 -1
  102. package/SVF-doxygen/html/html/search/functions_0.js +1 -1
  103. package/SVF-doxygen/html/html/search/functions_10.js +2 -1
  104. package/SVF-doxygen/html/html/search/functions_6.js +6 -4
  105. package/SVF-doxygen/html/html/search/variables_14.js +2 -2
  106. package/SVF-doxygen/html/html/search/variables_15.js +1 -1
  107. package/SVF-doxygen/html/html/search/variables_5.js +1 -0
  108. package/SVF-doxygen/html/html/search/variables_6.js +0 -1
  109. package/SVF-doxygen/html/html/search/variables_d.js +1 -1
  110. package/SVF-doxygen/html/html/search/variables_e.js +3 -1
  111. package/include/MemoryModel/SymbolTableInfo.h +37 -41
  112. package/lib/MemoryModel/LocationSet.cpp +42 -37
  113. package/lib/MemoryModel/SymbolTableInfo.cpp +71 -8
  114. package/package.json +1 -1
@@ -74,7 +74,7 @@ $(function() {
74
74
  <div class="ttc" id="classSVF_1_1GenericGraph_html_a0d9744b1b0e7a09a6f7af29188e243b7"><div class="ttname"><a href="classSVF_1_1GenericGraph.html#a0d9744b1b0e7a09a6f7af29188e243b7">SVF::GenericGraph::begin</a></div><div class="ttdeci">iterator begin()</div><div class="ttdoc">Iterators. </div><div class="ttdef"><b>Definition:</b> <a href="GenericGraph_8h_source.html#l00361">GenericGraph.h:361</a></div></div>
75
75
  <div class="ttc" id="classSVF_1_1SVFIR_html_a64939d7ecfd8e2cf862782954a56596b"><div class="ttname"><a href="classSVF_1_1SVFIR.html#a64939d7ecfd8e2cf862782954a56596b">SVF::SVFIR::SVFVarList</a></div><div class="ttdeci">std::vector&lt; const SVFVar * &gt; SVFVarList</div><div class="ttdef"><b>Definition:</b> <a href="SVFIR_8h_source.html#l00057">SVFIR.h:57</a></div></div>
76
76
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a7d47fbc3dbe8fd19ca5e4210bdecf914"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a7d47fbc3dbe8fd19ca5e4210bdecf914">SVF::MRGenerator::getModSideEffectOfFunction</a></div><div class="ttdeci">const NodeBS &amp; getModSideEffectOfFunction(const SVFFunction *fun)</div><div class="ttdoc">Get indirect mods of a function. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00389">MemRegion.h:389</a></div></div>
77
- <div class="ttc" id="classSVF_1_1MemObj_html"><div class="ttname"><a href="classSVF_1_1MemObj.html">SVF::MemObj</a></div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8h_source.html#l00422">SymbolTableInfo.h:422</a></div></div>
77
+ <div class="ttc" id="classSVF_1_1MemObj_html"><div class="ttname"><a href="classSVF_1_1MemObj.html">SVF::MemObj</a></div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8h_source.html#l00415">SymbolTableInfo.h:415</a></div></div>
78
78
  <div class="ttc" id="classSVF_1_1PTACallGraph_html_aaab54c670518d9d6790707f76ea76aa1"><div class="ttname"><a href="classSVF_1_1PTACallGraph.html#aaab54c670518d9d6790707f76ea76aa1">SVF::PTACallGraph::getCallGraphNode</a></div><div class="ttdeci">PTACallGraphNode * getCallGraphNode(NodeID id) const</div><div class="ttdoc">Get call graph node. </div><div class="ttdef"><b>Definition:</b> <a href="PTACallGraph_8h_source.html#l00315">PTACallGraph.h:315</a></div></div>
79
79
  <div class="ttc" id="classSVF_1_1SCCDetection_html_a6ab5eff6a576e6d8703c1ea29b7f425d"><div class="ttname"><a href="classSVF_1_1SCCDetection.html#a6ab5eff6a576e6d8703c1ea29b7f425d">SVF::SCCDetection::subNodes</a></div><div class="ttdeci">const NodeBS &amp; subNodes(NodeID n) const</div><div class="ttdoc">get all subnodes in one scc, if size is empty insert itself into the set </div><div class="ttdef"><b>Definition:</b> <a href="SCC_8h_source.html#l00173">SCC.h:173</a></div></div>
80
80
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a915486be8b119c1f1cc87143a2a5180e"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a915486be8b119c1f1cc87143a2a5180e">SVF::MRGenerator::addModSideEffectOfCallSite</a></div><div class="ttdeci">bool addModSideEffectOfCallSite(const CallICFGNode *cs, const NodeBS &amp;mods)</div><div class="ttdoc">Add indirect def an memory object in the function. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8cpp_source.html#l00447">MemRegion.cpp:447</a></div></div>
@@ -94,8 +94,8 @@ $(function() {
94
94
  <div class="ttc" id="util_8h_html_a07d17d6d5d1074c0969bc5d3c3d1d84a"><div class="ttname"><a href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a></div><div class="ttdeci">#define assert(ex)</div><div class="ttdef"><b>Definition:</b> <a href="util_8h_source.html#l00141">util.h:141</a></div></div>
95
95
  <div class="ttc" id="classSVF_1_1FIFOWorkList_html_a7056704c224dfb4b57287fe90c004aa8"><div class="ttname"><a href="classSVF_1_1FIFOWorkList.html#a7056704c224dfb4b57287fe90c004aa8">SVF::FIFOWorkList::empty</a></div><div class="ttdeci">bool empty() const</div><div class="ttdef"><b>Definition:</b> <a href="WorkList_8h_source.html#l00146">WorkList.h:146</a></div></div>
96
96
  <div class="ttc" id="classSVF_1_1ICFG_html_a392e5ea7c356763a988407f91343f034"><div class="ttname"><a href="classSVF_1_1ICFG.html#a392e5ea7c356763a988407f91343f034">SVF::ICFG::getRetBlockNode</a></div><div class="ttdeci">RetICFGNode * getRetBlockNode(const Instruction *inst)</div><div class="ttdef"><b>Definition:</b> <a href="ICFG_8cpp_source.html#l00222">ICFG.cpp:222</a></div></div>
97
- <div class="ttc" id="classSVF_1_1MemObj_html_a40462512a99eb258d8cd442c38d812b4"><div class="ttname"><a href="classSVF_1_1MemObj.html#a40462512a99eb258d8cd442c38d812b4">SVF::MemObj::isGlobalObj</a></div><div class="ttdeci">bool isGlobalObj() const</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00672">SymbolTableInfo.cpp:672</a></div></div>
98
- <div class="ttc" id="classSVF_1_1MemObj_html_af7316c697eafc71d5fc93108da4e2cee"><div class="ttname"><a href="classSVF_1_1MemObj.html#af7316c697eafc71d5fc93108da4e2cee">SVF::MemObj::isStack</a></div><div class="ttdeci">bool isStack() const</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00682">SymbolTableInfo.cpp:682</a></div></div>
97
+ <div class="ttc" id="classSVF_1_1MemObj_html_a40462512a99eb258d8cd442c38d812b4"><div class="ttname"><a href="classSVF_1_1MemObj.html#a40462512a99eb258d8cd442c38d812b4">SVF::MemObj::isGlobalObj</a></div><div class="ttdeci">bool isGlobalObj() const</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00735">SymbolTableInfo.cpp:735</a></div></div>
98
+ <div class="ttc" id="classSVF_1_1MemObj_html_af7316c697eafc71d5fc93108da4e2cee"><div class="ttname"><a href="classSVF_1_1MemObj.html#af7316c697eafc71d5fc93108da4e2cee">SVF::MemObj::isStack</a></div><div class="ttdeci">bool isStack() const</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00745">SymbolTableInfo.cpp:745</a></div></div>
99
99
  <div class="ttc" id="classSVF_1_1SVFIR_html_abb91ed47d5c13d0ad7eec35164e37988"><div class="ttname"><a href="classSVF_1_1SVFIR.html#abb91ed47d5c13d0ad7eec35164e37988">SVF::SVFIR::getPTASVFStmtList</a></div><div class="ttdeci">SVFStmtList &amp; getPTASVFStmtList(const ICFGNode *inst)</div><div class="ttdoc">Given an instruction, get all its PTA PAGEdges. </div><div class="ttdef"><b>Definition:</b> <a href="SVFIR_8h_source.html#l00186">SVFIR.h:186</a></div></div>
100
100
  <div class="ttc" id="classSVF_1_1GenericEdge_html_ae6792506a0150a9400d635eceab7f9e7"><div class="ttname"><a href="classSVF_1_1GenericEdge.html#ae6792506a0150a9400d635eceab7f9e7">SVF::GenericEdge::getSrcID</a></div><div class="ttdeci">NodeID getSrcID() const</div><div class="ttdoc">get methods of the components </div><div class="ttdef"><b>Definition:</b> <a href="GenericGraph_8h_source.html#l00073">GenericGraph.h:73</a></div></div>
101
101
  <div class="ttc" id="classSVF_1_1MRGenerator_html_adc9d530e6f010596d91cd3711dc1358b"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#adc9d530e6f010596d91cd3711dc1358b">SVF::MRGenerator::modRefAnalysis</a></div><div class="ttdeci">virtual void modRefAnalysis(PTACallGraphNode *callGraphNode, WorkList &amp;worklist)</div><div class="ttdoc">Mod-Ref analysis for callsite invoking this callGraphNode. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8cpp_source.html#l00635">MemRegion.cpp:635</a></div></div>
@@ -161,7 +161,7 @@ $(function() {
161
161
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a7a7ed21181c2486b60170a479a5a534e"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a7a7ed21181c2486b60170a479a5a534e">SVF::MRGenerator::callsiteToRefMRsMap</a></div><div class="ttdeci">CallSiteToMRsMap callsiteToRefMRsMap</div><div class="ttdoc">Map a callsite to its refs regions. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00205">MemRegion.h:205</a></div></div>
162
162
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a2c94bfa19ad8d1d6360b12693c8b891d"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a2c94bfa19ad8d1d6360b12693c8b891d">SVF::MRGenerator::funToModsMap</a></div><div class="ttdeci">FunToPointsToMap funToModsMap</div><div class="ttdoc">Map a function to its indirect defs of memory objects. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00225">MemRegion.h:225</a></div></div>
163
163
  <div class="ttc" id="classSVF_1_1IRGraph_html_aceb17dfbe137658625e16291127267d1"><div class="ttname"><a href="classSVF_1_1IRGraph.html#aceb17dfbe137658625e16291127267d1">SVF::IRGraph::hasValueNode</a></div><div class="ttdeci">bool hasValueNode(const Value *V)</div><div class="ttdef"><b>Definition:</b> <a href="IRGraph_8h_source.html#l00124">IRGraph.h:124</a></div></div>
164
- <div class="ttc" id="classSVF_1_1SymbolTableInfo_html_a267169023fc4f8dd66b145f7231fec11"><div class="ttname"><a href="classSVF_1_1SymbolTableInfo.html#a267169023fc4f8dd66b145f7231fec11">SVF::SymbolTableInfo::SymbolInfo</a></div><div class="ttdeci">static SymbolTableInfo * SymbolInfo()</div><div class="ttdoc">Singleton design here to make sure we only have one instance during any analysis. ...</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00059">SymbolTableInfo.cpp:59</a></div></div>
164
+ <div class="ttc" id="classSVF_1_1SymbolTableInfo_html_a267169023fc4f8dd66b145f7231fec11"><div class="ttname"><a href="classSVF_1_1SymbolTableInfo.html#a267169023fc4f8dd66b145f7231fec11">SVF::SymbolTableInfo::SymbolInfo</a></div><div class="ttdeci">static SymbolTableInfo * SymbolInfo()</div><div class="ttdoc">Singleton design here to make sure we only have one instance during any analysis. ...</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00101">SymbolTableInfo.cpp:101</a></div></div>
165
165
  <div class="ttc" id="classSVF_1_1SVFIR_html_a63acb4d86d93ad1e88860ac839a8c654"><div class="ttname"><a href="classSVF_1_1SVFIR.html#a63acb4d86d93ad1e88860ac839a8c654">SVF::SVFIR::hasSVFStmtList</a></div><div class="ttdeci">bool hasSVFStmtList(const ICFGNode *inst) const</div><div class="ttdoc">Whether this instruction has SVFIR Edge. </div><div class="ttdef"><b>Definition:</b> <a href="SVFIR_8h_source.html#l00172">SVFIR.h:172</a></div></div>
166
166
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a502f8379620378b36bc12d9a91b408d2"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a502f8379620378b36bc12d9a91b408d2">SVF::MRGenerator::collectModRefForCall</a></div><div class="ttdeci">virtual void collectModRefForCall()</div><div class="ttdoc">Generate regions for calls/rets. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8cpp_source.html#l00228">MemRegion.cpp:228</a></div></div>
167
167
  <div class="ttc" id="classSVF_1_1MRGenerator_html_ab250a4950269f57027d8e8ef10089f58"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#ab250a4950269f57027d8e8ef10089f58">SVF::MRGenerator::pagEdgeToFunMap</a></div><div class="ttdeci">PAGEdgeToFunMap pagEdgeToFunMap</div><div class="ttdoc">Map a PAGEdge to its fun. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00220">MemRegion.h:220</a></div></div>
@@ -179,7 +179,7 @@ $(function() {
179
179
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a0e46c7beb580ace3a652ac9e1c419b48"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a0e46c7beb580ace3a652ac9e1c419b48">SVF::MRGenerator::cachedPtsChainMap</a></div><div class="ttdeci">NodeToPTSSMap cachedPtsChainMap</div><div class="ttdoc">Map a pointer to its cached points-to chain;. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00236">MemRegion.h:236</a></div></div>
180
180
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a79a3032b50f7ef905213b770b12e0967"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a79a3032b50f7ef905213b770b12e0967">SVF::MRGenerator::addCPtsToLoad</a></div><div class="ttdeci">void addCPtsToLoad(NodeBS &amp;cpts, const LoadStmt *ld, const SVFFunction *fun)</div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00343">MemRegion.h:343</a></div></div>
181
181
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a39604645ca9ba10607ada3872b14705a"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a39604645ca9ba10607ada3872b14705a">SVF::MRGenerator::addModSideEffectOfFunction</a></div><div class="ttdeci">void addModSideEffectOfFunction(const SVFFunction *fun, const NodeBS &amp;mods)</div><div class="ttdoc">Add indirect def an memory object in the function. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8cpp_source.html#l00419">MemRegion.cpp:419</a></div></div>
182
- <div class="ttc" id="classSVF_1_1MemObj_html_a898c5bb3956402578266a6fb142e02b1"><div class="ttname"><a href="classSVF_1_1MemObj.html#a898c5bb3956402578266a6fb142e02b1">SVF::MemObj::isHeap</a></div><div class="ttdeci">bool isHeap() const</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00687">SymbolTableInfo.cpp:687</a></div></div>
182
+ <div class="ttc" id="classSVF_1_1MemObj_html_a898c5bb3956402578266a6fb142e02b1"><div class="ttname"><a href="classSVF_1_1MemObj.html#a898c5bb3956402578266a6fb142e02b1">SVF::MemObj::isHeap</a></div><div class="ttdeci">bool isHeap() const</div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8cpp_source.html#l00750">SymbolTableInfo.cpp:750</a></div></div>
183
183
  <div class="ttc" id="SVFBasicTypes_8h_html_a2c64190a065f342897573a3ef4973adb"><div class="ttname"><a href="SVFBasicTypes_8h.html#a2c64190a065f342897573a3ef4973adb">DGENERAL</a></div><div class="ttdeci">#define DGENERAL</div><div class="ttdoc">General debug flag is for each phase of a pass, it is often in a colorful output format. </div><div class="ttdef"><b>Definition:</b> <a href="SVFBasicTypes_8h_source.html#l00154">SVFBasicTypes.h:154</a></div></div>
184
184
  <div class="ttc" id="classSVF_1_1CallICFGNode_html_a674753d5ca0fbe28674acb25291f2bcf"><div class="ttname"><a href="classSVF_1_1CallICFGNode.html#a674753d5ca0fbe28674acb25291f2bcf">SVF::CallICFGNode::getCallSite</a></div><div class="ttdeci">const Instruction * getCallSite() const</div><div class="ttdoc">Return callsite. </div><div class="ttdef"><b>Definition:</b> <a href="ICFGNode_8h_source.html#l00381">ICFGNode.h:381</a></div></div>
185
185
  <div class="ttc" id="classSVF_1_1MRGenerator_html_ad740188222439c089907fa6c6c951f02"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#ad740188222439c089907fa6c6c951f02">SVF::MRGenerator::getAliasMemRegions</a></div><div class="ttdeci">virtual void getAliasMemRegions(MRSet &amp;aliasMRs, const NodeBS &amp;cpts, const SVFFunction *fun)</div><div class="ttdoc">Get all aliased mem regions from function fun according to cpts. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00305">MemRegion.h:305</a></div></div>
@@ -208,7 +208,7 @@ $(function() {
208
208
  <div class="ttc" id="classSVF_1_1StoreStmt_html"><div class="ttname"><a href="classSVF_1_1StoreStmt.html">SVF::StoreStmt</a></div><div class="ttdef"><b>Definition:</b> <a href="SVFStatements_8h_source.html#l00336">SVFStatements.h:336</a></div></div>
209
209
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a187d82895b2e1156c6dd5ae28795944f"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a187d82895b2e1156c6dd5ae28795944f">SVF::MRGenerator::hasModSideEffectOfCallSite</a></div><div class="ttdeci">bool hasModSideEffectOfCallSite(const CallICFGNode *cs)</div><div class="ttdoc">Has indirect mods of a callsite. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00409">MemRegion.h:409</a></div></div>
210
210
  <div class="ttc" id="classSVF_1_1MRGenerator_html_abe8d6217250d227e743e4b581497aae8"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#abe8d6217250d227e743e4b581497aae8">SVF::MRGenerator::getMRsForLoad</a></div><div class="ttdeci">virtual void getMRsForLoad(MRSet &amp;aliasMRs, const NodeBS &amp;cpts, const SVFFunction *)</div><div class="ttdoc">Get memory regions for a load statement according to cpts. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8h_source.html#l00315">MemRegion.h:315</a></div></div>
211
- <div class="ttc" id="classSVF_1_1MemObj_html_a4da54ef60231d2e6c26669226b99d2f3"><div class="ttname"><a href="classSVF_1_1MemObj.html#a4da54ef60231d2e6c26669226b99d2f3">SVF::MemObj::getValue</a></div><div class="ttdeci">const Value * getValue() const</div><div class="ttdoc">Get the reference value to this object. </div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8h_source.html#l00446">SymbolTableInfo.h:446</a></div></div>
211
+ <div class="ttc" id="classSVF_1_1MemObj_html_a4da54ef60231d2e6c26669226b99d2f3"><div class="ttname"><a href="classSVF_1_1MemObj.html#a4da54ef60231d2e6c26669226b99d2f3">SVF::MemObj::getValue</a></div><div class="ttdeci">const Value * getValue() const</div><div class="ttdoc">Get the reference value to this object. </div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8h_source.html#l00439">SymbolTableInfo.h:439</a></div></div>
212
212
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a66d94d15fb94e90a771f6b3dd7c0ecdd"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a66d94d15fb94e90a771f6b3dd7c0ecdd">SVF::MRGenerator::sortPointsTo</a></div><div class="ttdeci">virtual void sortPointsTo(const NodeBS &amp;cpts)</div><div class="ttdoc">Given a condition pts, insert into cptsToRepCPtsMap for region generation. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8cpp_source.html#l00284">MemRegion.cpp:284</a></div></div>
213
213
  <div class="ttc" id="classSVF_1_1MRGenerator_html_a207dfa4c9f044764665478142c6e6b22"><div class="ttname"><a href="classSVF_1_1MRGenerator.html#a207dfa4c9f044764665478142c6e6b22">SVF::MRGenerator::collectModRefForLoadStore</a></div><div class="ttdeci">virtual void collectModRefForLoadStore()</div><div class="ttdoc">Generate regions for loads/stores. </div><div class="ttdef"><b>Definition:</b> <a href="MemRegion_8cpp_source.html#l00172">MemRegion.cpp:172</a></div></div>
214
214
  <div class="ttc" id="classSVF_1_1PTACallGraphNode_html_a796994541eec90f2b540e24816120aff"><div class="ttname"><a href="classSVF_1_1PTACallGraphNode.html#a796994541eec90f2b540e24816120aff">SVF::PTACallGraphNode::iterator</a></div><div class="ttdeci">PTACallGraphEdge::CallGraphEdgeSet::iterator iterator</div><div class="ttdef"><b>Definition:</b> <a href="PTACallGraph_8h_source.html#l00179">PTACallGraph.h:179</a></div></div>
@@ -66,7 +66,7 @@ $(function() {
66
66
  <div class="title">PAGBuilderFromFile.cpp</div> </div>
67
67
  </div><!--header-->
68
68
  <div class="contents">
69
- <a href="PAGBuilderFromFile_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">//===- PAGBuilderFromFile.cpp -- SVFIR builder-------------------------------//</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// SVF: Static Value-Flow Analysis</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">// Copyright (C) &lt;2013-2018&gt; &lt;Yulei Sui&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// This program is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// (at your option) any later version.</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment">// This program is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">// GNU General Public License for more details.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">// You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment">// along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">//===----------------------------------------------------------------------===//</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="comment"> * PAGBuilderFromFile.cpp</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="comment"> * Created on: 20 Sep. 2018</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment"> * Author: 136884</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PAGBuilderFromFile_8h.html">MemoryModel/PAGBuilderFromFile.h</a>&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span> <span class="comment">// for PAGBuilderFromFile</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span> <span class="comment">// for PAGBuilderFromFile</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span> <span class="comment">// for PAGBuilderFromFile</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceSVF.html">SVF</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">using namespace </span>SVFUtil;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="PAGBuilderFromFile_8cpp.html#a1af3947dbaf1ad4364bc4818f70ead40"> 38</a></span>&#160;<span class="keyword">static</span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="PAGBuilderFromFile_8cpp.html#a1af3947dbaf1ad4364bc4818f70ead40">gepNodeNumIndex</a> = 100000;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment"> * You can build a SVFIR from a file written by yourself</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment"> * The file should follow the format:</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment"> * Node: nodeID Nodetype</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="comment"> * Edge: nodeID edgetype NodeID Offset</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="comment"> * like:</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment">5 o</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">6 v</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment">7 v</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment">8 v</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment">9 v</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="comment">5 addr 6 0</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment">6 gep 7 4</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="comment">7 copy 8 0</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="comment">6 store 8 0</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment">8 load 9 0</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classSVF_1_1PAGBuilderFromFile.html#ac5a5058088d03fc9e0e8a0ed8b4367aa"> 59</a></span>&#160;<a class="code" href="classSVF_1_1SVFIR.html">SVFIR</a>* PAGBuilderFromFile::build()</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;{</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordtype">string</span> line;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; ifstream myfile(file.c_str());</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">if</span> (myfile.is_open())</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; {</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">while</span> (myfile.good())</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; getline(myfile, line);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> token_count = 0;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordtype">string</span> tmps;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; istringstream ss(line);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">while</span> (ss.good())</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; ss &gt;&gt; tmps;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; token_count++;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">if</span> (token_count == 0)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (token_count == 2)</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> nodeId;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordtype">string</span> nodetype;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; istringstream ss(line);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; ss &gt;&gt; nodeId;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; ss &gt;&gt; nodetype;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;reading node :&quot;</span> &lt;&lt; nodeId &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">if</span> (nodetype == <span class="stringliteral">&quot;v&quot;</span>)</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; pag-&gt;addDummyValNode(nodeId);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nodetype == <span class="stringliteral">&quot;o&quot;</span>)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keyword">const</span> <a class="code" href="classSVF_1_1MemObj.html">MemObj</a>* mem = pag-&gt;addDummyMemObj(nodeId, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; pag-&gt;addFIObjNode(mem);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; }</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;format not support, pls specify node type&quot;</span>);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; }</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="comment">// do consider gep edge</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (token_count == 4)</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> nodeSrc;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> nodeDst;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="code" href="namespaceSVF.html#abe09d99af006554a5c00803e9a89f9a6">s64_t</a> offsetOrCSId;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordtype">string</span> edge;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; istringstream ss(line);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; ss &gt;&gt; nodeSrc;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; ss &gt;&gt; edge;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; ss &gt;&gt; nodeDst;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; ss &gt;&gt; offsetOrCSId;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;reading edge :&quot;</span> &lt;&lt; nodeSrc &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; edge &lt;&lt; <span class="stringliteral">&quot; &quot;</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; &lt;&lt; nodeDst &lt;&lt; <span class="stringliteral">&quot; offsetOrCSId=&quot;</span> &lt;&lt; offsetOrCSId &lt;&lt; <span class="stringliteral">&quot; \n&quot;</span>;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; addEdge(nodeSrc, nodeDst, offsetOrCSId, edge);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; }</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; {</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">if</span> (!line.empty())</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;format not supported, token count = &quot;</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; &lt;&lt; token_count &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;format not supported&quot;</span>);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; }</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; }</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; myfile.close();</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; }</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;Unable to open file\n&quot;</span>;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> lower_bound = <a class="code" href="PAGBuilderFromFile_8cpp.html#a1af3947dbaf1ad4364bc4818f70ead40">gepNodeNumIndex</a>;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">for</span>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> i = 0; i &lt; lower_bound; i++)</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; pag-&gt;incNodeNum();</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; pag-&gt;setNodeNumAfterPAGBuild(pag-&gt;getTotalNodeNum());</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordflow">return</span> pag;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;}</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classSVF_1_1PAGBuilderFromFile.html#ac34cd4f9426da0325e67bc1b3d7bcecd"> 146</a></span>&#160;<span class="keywordtype">void</span> PAGBuilderFromFile::addEdge(<a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> srcID, <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> dstID,</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <a class="code" href="namespaceSVF.html#abe09d99af006554a5c00803e9a89f9a6">s64_t</a> offsetOrCSId, std::string edge)</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;{</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="comment">//check whether these two nodes available</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="code" href="classSVF_1_1SVFVar.html">PAGNode</a>* srcNode = pag-&gt;getGNode(srcID);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <a class="code" href="classSVF_1_1SVFVar.html">PAGNode</a>* dstNode = pag-&gt;getGNode(dstID);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(SVFUtil::isa&lt;ValVar&gt;(dstNode) &amp;&amp; <span class="stringliteral">&quot;dst not an value node?&quot;</span>);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">if</span>(edge==<span class="stringliteral">&quot;addr&quot;</span>)</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(SVFUtil::isa&lt;ObjVar&gt;(srcNode) &amp;&amp; <span class="stringliteral">&quot;src not an value node?&quot;</span>);</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!SVFUtil::isa&lt;ObjVar&gt;(srcNode) &amp;&amp; <span class="stringliteral">&quot;src not an object node?&quot;</span>);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;addr&quot;</span>)</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; {</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; pag-&gt;addAddrStmt(srcID, dstID);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; }</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;copy&quot;</span>)</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; pag-&gt;addCopyStmt(srcID, dstID);</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;load&quot;</span>)</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; pag-&gt;addLoadStmt(srcID, dstID);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;store&quot;</span>)</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; pag-&gt;addStoreStmt(srcID, dstID, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;gep&quot;</span>)</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; pag-&gt;addNormalGepStmt(srcID, dstID, <a class="code" href="classSVF_1_1LocationSet.html">LocationSet</a>(offsetOrCSId));</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;variant-gep&quot;</span>)</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; pag-&gt;addVariantGepStmt(srcID, dstID, <a class="code" href="classSVF_1_1LocationSet.html">LocationSet</a>(offsetOrCSId));</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;call&quot;</span>)</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; pag-&gt;addEdge(srcNode, dstNode, <span class="keyword">new</span> <a class="code" href="classSVF_1_1CallPE.html">CallPE</a>(srcNode, dstNode, <span class="keyword">nullptr</span>));</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;ret&quot;</span>)</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; pag-&gt;addEdge(srcNode, dstNode, <span class="keyword">new</span> <a class="code" href="classSVF_1_1RetPE.html">RetPE</a>(srcNode, dstNode, <span class="keyword">nullptr</span>));</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;cmp&quot;</span>)</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; pag-&gt;addCmpStmt(srcID, dstID, dstID, dstID);</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;binary-op&quot;</span>)</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; pag-&gt;addBinaryOPStmt(srcID, dstID, dstID, dstID);</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;unary-op&quot;</span>)</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; pag-&gt;addUnaryOPStmt(srcID, dstID, dstID);</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;phi&quot;</span>)</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; pag-&gt;addPhiStmt(srcID, dstID);</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;branch&quot;</span>){</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;fix successors here!&quot;</span>);</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">//pag-&gt;addBranchStmt(srcID, dstID, nullptr);</span></div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; }</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;format not support, can not create such edge&quot;</span>);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;}</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div><div class="ttc" id="classSVF_1_1MemObj_html"><div class="ttname"><a href="classSVF_1_1MemObj.html">SVF::MemObj</a></div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8h_source.html#l00422">SymbolTableInfo.h:422</a></div></div>
69
+ <a href="PAGBuilderFromFile_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">//===- PAGBuilderFromFile.cpp -- SVFIR builder-------------------------------//</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// SVF: Static Value-Flow Analysis</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">// Copyright (C) &lt;2013-2018&gt; &lt;Yulei Sui&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// This program is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// (at your option) any later version.</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment">// This program is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">// GNU General Public License for more details.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">// You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment">// along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">//===----------------------------------------------------------------------===//</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="comment"> * PAGBuilderFromFile.cpp</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="comment"> * Created on: 20 Sep. 2018</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment"> * Author: 136884</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PAGBuilderFromFile_8h.html">MemoryModel/PAGBuilderFromFile.h</a>&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span> <span class="comment">// for PAGBuilderFromFile</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span> <span class="comment">// for PAGBuilderFromFile</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span> <span class="comment">// for PAGBuilderFromFile</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceSVF.html">SVF</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">using namespace </span>SVFUtil;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="PAGBuilderFromFile_8cpp.html#a1af3947dbaf1ad4364bc4818f70ead40"> 38</a></span>&#160;<span class="keyword">static</span> <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> <a class="code" href="PAGBuilderFromFile_8cpp.html#a1af3947dbaf1ad4364bc4818f70ead40">gepNodeNumIndex</a> = 100000;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment"> * You can build a SVFIR from a file written by yourself</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment"> * The file should follow the format:</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment"> * Node: nodeID Nodetype</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="comment"> * Edge: nodeID edgetype NodeID Offset</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="comment"> * like:</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment">5 o</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">6 v</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment">7 v</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment">8 v</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment">9 v</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="comment">5 addr 6 0</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment">6 gep 7 4</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="comment">7 copy 8 0</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="comment">6 store 8 0</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment">8 load 9 0</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classSVF_1_1PAGBuilderFromFile.html#ac5a5058088d03fc9e0e8a0ed8b4367aa"> 59</a></span>&#160;<a class="code" href="classSVF_1_1SVFIR.html">SVFIR</a>* PAGBuilderFromFile::build()</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;{</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordtype">string</span> line;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; ifstream myfile(file.c_str());</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">if</span> (myfile.is_open())</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; {</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">while</span> (myfile.good())</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; getline(myfile, line);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> token_count = 0;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordtype">string</span> tmps;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; istringstream ss(line);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">while</span> (ss.good())</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; ss &gt;&gt; tmps;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; token_count++;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">if</span> (token_count == 0)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (token_count == 2)</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> nodeId;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordtype">string</span> nodetype;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; istringstream ss(line);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; ss &gt;&gt; nodeId;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; ss &gt;&gt; nodetype;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;reading node :&quot;</span> &lt;&lt; nodeId &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">if</span> (nodetype == <span class="stringliteral">&quot;v&quot;</span>)</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; pag-&gt;addDummyValNode(nodeId);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nodetype == <span class="stringliteral">&quot;o&quot;</span>)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keyword">const</span> <a class="code" href="classSVF_1_1MemObj.html">MemObj</a>* mem = pag-&gt;addDummyMemObj(nodeId, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; pag-&gt;addFIObjNode(mem);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; }</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;format not support, pls specify node type&quot;</span>);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; }</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="comment">// do consider gep edge</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (token_count == 4)</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> nodeSrc;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> nodeDst;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="code" href="namespaceSVF.html#abe09d99af006554a5c00803e9a89f9a6">s64_t</a> offsetOrCSId;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordtype">string</span> edge;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; istringstream ss(line);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; ss &gt;&gt; nodeSrc;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; ss &gt;&gt; edge;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; ss &gt;&gt; nodeDst;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; ss &gt;&gt; offsetOrCSId;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;reading edge :&quot;</span> &lt;&lt; nodeSrc &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; edge &lt;&lt; <span class="stringliteral">&quot; &quot;</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; &lt;&lt; nodeDst &lt;&lt; <span class="stringliteral">&quot; offsetOrCSId=&quot;</span> &lt;&lt; offsetOrCSId &lt;&lt; <span class="stringliteral">&quot; \n&quot;</span>;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; addEdge(nodeSrc, nodeDst, offsetOrCSId, edge);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; }</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; {</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">if</span> (!line.empty())</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;format not supported, token count = &quot;</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; &lt;&lt; token_count &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;format not supported&quot;</span>);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; }</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; }</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; myfile.close();</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; }</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="namespaceSVF_1_1SVFUtil.html#a85ab6b592fefc45a0674d3295e01638f">outs</a>() &lt;&lt; <span class="stringliteral">&quot;Unable to open file\n&quot;</span>;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> lower_bound = <a class="code" href="PAGBuilderFromFile_8cpp.html#a1af3947dbaf1ad4364bc4818f70ead40">gepNodeNumIndex</a>;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">for</span>(<a class="code" href="namespaceSVF.html#ad42bff8d0a7d60a085aa32d10f4955af">u32_t</a> i = 0; i &lt; lower_bound; i++)</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; pag-&gt;incNodeNum();</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; pag-&gt;setNodeNumAfterPAGBuild(pag-&gt;getTotalNodeNum());</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordflow">return</span> pag;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;}</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classSVF_1_1PAGBuilderFromFile.html#ac34cd4f9426da0325e67bc1b3d7bcecd"> 146</a></span>&#160;<span class="keywordtype">void</span> PAGBuilderFromFile::addEdge(<a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> srcID, <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> dstID,</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <a class="code" href="namespaceSVF.html#abe09d99af006554a5c00803e9a89f9a6">s64_t</a> offsetOrCSId, std::string edge)</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;{</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="comment">//check whether these two nodes available</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="code" href="classSVF_1_1SVFVar.html">PAGNode</a>* srcNode = pag-&gt;getGNode(srcID);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <a class="code" href="classSVF_1_1SVFVar.html">PAGNode</a>* dstNode = pag-&gt;getGNode(dstID);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(SVFUtil::isa&lt;ValVar&gt;(dstNode) &amp;&amp; <span class="stringliteral">&quot;dst not an value node?&quot;</span>);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">if</span>(edge==<span class="stringliteral">&quot;addr&quot;</span>)</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(SVFUtil::isa&lt;ObjVar&gt;(srcNode) &amp;&amp; <span class="stringliteral">&quot;src not an value node?&quot;</span>);</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(!SVFUtil::isa&lt;ObjVar&gt;(srcNode) &amp;&amp; <span class="stringliteral">&quot;src not an object node?&quot;</span>);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;addr&quot;</span>)</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; {</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; pag-&gt;addAddrStmt(srcID, dstID);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; }</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;copy&quot;</span>)</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; pag-&gt;addCopyStmt(srcID, dstID);</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;load&quot;</span>)</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; pag-&gt;addLoadStmt(srcID, dstID);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;store&quot;</span>)</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; pag-&gt;addStoreStmt(srcID, dstID, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;gep&quot;</span>)</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; pag-&gt;addNormalGepStmt(srcID, dstID, <a class="code" href="classSVF_1_1LocationSet.html">LocationSet</a>(offsetOrCSId));</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;variant-gep&quot;</span>)</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; pag-&gt;addVariantGepStmt(srcID, dstID, <a class="code" href="classSVF_1_1LocationSet.html">LocationSet</a>(offsetOrCSId));</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;call&quot;</span>)</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; pag-&gt;addEdge(srcNode, dstNode, <span class="keyword">new</span> <a class="code" href="classSVF_1_1CallPE.html">CallPE</a>(srcNode, dstNode, <span class="keyword">nullptr</span>));</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;ret&quot;</span>)</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; pag-&gt;addEdge(srcNode, dstNode, <span class="keyword">new</span> <a class="code" href="classSVF_1_1RetPE.html">RetPE</a>(srcNode, dstNode, <span class="keyword">nullptr</span>));</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;cmp&quot;</span>)</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; pag-&gt;addCmpStmt(srcID, dstID, dstID, dstID);</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;binary-op&quot;</span>)</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; pag-&gt;addBinaryOPStmt(srcID, dstID, dstID, dstID);</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;unary-op&quot;</span>)</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; pag-&gt;addUnaryOPStmt(srcID, dstID, dstID);</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;phi&quot;</span>)</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; pag-&gt;addPhiStmt(srcID, dstID);</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edge == <span class="stringliteral">&quot;branch&quot;</span>){</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;fix successors here!&quot;</span>);</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">//pag-&gt;addBranchStmt(srcID, dstID, nullptr);</span></div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; }</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> &amp;&amp; <span class="stringliteral">&quot;format not support, can not create such edge&quot;</span>);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;}</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div><div class="ttc" id="classSVF_1_1MemObj_html"><div class="ttname"><a href="classSVF_1_1MemObj.html">SVF::MemObj</a></div><div class="ttdef"><b>Definition:</b> <a href="SymbolTableInfo_8h_source.html#l00415">SymbolTableInfo.h:415</a></div></div>
70
70
  <div class="ttc" id="classSVF_1_1RetPE_html"><div class="ttname"><a href="classSVF_1_1RetPE.html">SVF::RetPE</a></div><div class="ttdef"><b>Definition:</b> <a href="SVFStatements_8h_source.html#l00521">SVFStatements.h:521</a></div></div>
71
71
  <div class="ttc" id="PAGBuilderFromFile_8cpp_html_a1af3947dbaf1ad4364bc4818f70ead40"><div class="ttname"><a href="PAGBuilderFromFile_8cpp.html#a1af3947dbaf1ad4364bc4818f70ead40">gepNodeNumIndex</a></div><div class="ttdeci">static u32_t gepNodeNumIndex</div><div class="ttdef"><b>Definition:</b> <a href="PAGBuilderFromFile_8cpp_source.html#l00038">PAGBuilderFromFile.cpp:38</a></div></div>
72
72
  <div class="ttc" id="namespaceSVF_html_a43a65e0d33af3c743294f7a1139d2301"><div class="ttname"><a href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">SVF::NodeID</a></div><div class="ttdeci">unsigned NodeID</div><div class="ttdef"><b>Definition:</b> <a href="MTAResultValidator_8h_source.html#l00018">MTAResultValidator.h:18</a></div></div>