svf-tools 1.0.367 → 1.0.371
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SVF-doxygen/html/html/AndersenStat_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ConsG_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/ConsG_8h_source.html +2 -2
- package/SVF-doxygen/html/html/DDAClient_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/DDAClient_8h_source.html +1 -1
- package/SVF-doxygen/html/html/DDAPass_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ExtAPI_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ExtAPI_8h_source.html +2 -2
- package/SVF-doxygen/html/html/Graph2Json_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/ICFGBuilder_8cpp_source.html +9 -7
- package/SVF-doxygen/html/html/ICFGBuilder_8h_source.html +4 -4
- package/SVF-doxygen/html/html/ICFGEdge_8h_source.html +51 -41
- package/SVF-doxygen/html/html/ICFGNode_8h_source.html +2 -2
- package/SVF-doxygen/html/html/ICFGStat_8h_source.html +4 -4
- package/SVF-doxygen/html/html/ICFG_8cpp_source.html +22 -19
- package/SVF-doxygen/html/html/ICFG_8h_source.html +6 -5
- package/SVF-doxygen/html/html/IRAnnotator_8h_source.html +1 -1
- package/SVF-doxygen/html/html/MTAAnnotator_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8h_source.html +1 -1
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +2 -2
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +10 -6
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +40 -40
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +40 -40
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +38 -38
- package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +73 -75
- package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/VFGNode_8h_source.html +5 -5
- package/SVF-doxygen/html/html/VFG_8cpp_source.html +9 -9
- package/SVF-doxygen/html/html/VFG_8h_source.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1BinaryOPStmt-members.html +42 -43
- package/SVF-doxygen/html/html/classSVF_1_1BinaryOPStmt.html +15 -18
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +31 -31
- package/SVF-doxygen/html/html/classSVF_1_1BranchVFGNode.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1CallCFGEdge-members.html +28 -25
- package/SVF-doxygen/html/html/classSVF_1_1CallCFGEdge.html +108 -15
- package/SVF-doxygen/html/html/classSVF_1_1CallICFGNode-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CallICFGNode.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1CmpStmt-members.html +42 -43
- package/SVF-doxygen/html/html/classSVF_1_1CmpStmt.html +16 -19
- package/SVF-doxygen/html/html/classSVF_1_1CondPTAImpl.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1DDAClient.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1DDAPass.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ExtAPI.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ICFG-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ICFG.html +30 -26
- package/SVF-doxygen/html/html/classSVF_1_1ICFGBuilder.html +22 -17
- package/SVF-doxygen/html/html/classSVF_1_1ICFGEdge.html +30 -30
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1IntraCFGEdge-members.html +27 -26
- package/SVF-doxygen/html/html/classSVF_1_1IntraCFGEdge.html +121 -82
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1MTAAnnotator.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1MultiOpndStmt-members.html +45 -46
- package/SVF-doxygen/html/html/classSVF_1_1MultiOpndStmt.html +8 -46
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +1 -2
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1PhiStmt-members.html +47 -48
- package/SVF-doxygen/html/html/classSVF_1_1PhiStmt.html +32 -33
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1RetCFGEdge-members.html +23 -20
- package/SVF-doxygen/html/html/classSVF_1_1RetCFGEdge.html +110 -15
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +87 -86
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +87 -76
- package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SelectStmt-members.html +44 -45
- package/SVF-doxygen/html/html/classSVF_1_1SelectStmt.html +21 -24
- package/SVF-doxygen/html/html/classSVF_1_1TDForkPE.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1TDJoinPE.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1UnaryOPStmt.html +20 -20
- package/SVF-doxygen/html/html/classSVF_1_1VFG.html +10 -10
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +1 -1
- package/SVF-doxygen/html/html/functions_a.html +12 -10
- package/SVF-doxygen/html/html/functions_b.html +7 -12
- package/SVF-doxygen/html/html/functions_c.html +22 -18
- package/SVF-doxygen/html/html/functions_f.html +3 -3
- package/SVF-doxygen/html/html/functions_func.html +13 -11
- package/SVF-doxygen/html/html/functions_func_g.html +19 -17
- package/SVF-doxygen/html/html/functions_func_s.html +2 -2
- package/SVF-doxygen/html/html/functions_g.html +20 -18
- package/SVF-doxygen/html/html/functions_n.html +6 -6
- package/SVF-doxygen/html/html/functions_p.html +15 -15
- package/SVF-doxygen/html/html/functions_r.html +5 -2
- package/SVF-doxygen/html/html/functions_s.html +11 -11
- package/SVF-doxygen/html/html/functions_type_b.html +0 -3
- package/SVF-doxygen/html/html/functions_vars_b.html +2 -2
- package/SVF-doxygen/html/html/functions_vars_c.html +5 -1
- package/SVF-doxygen/html/html/functions_vars_r.html +3 -0
- package/SVF-doxygen/html/html/functions_w.html +5 -9
- package/SVF-doxygen/html/html/namespaceSVF.html +1 -1
- package/SVF-doxygen/html/html/search/all_1.js +3 -3
- package/SVF-doxygen/html/html/search/all_10.js +7 -7
- package/SVF-doxygen/html/html/search/all_12.js +3 -3
- package/SVF-doxygen/html/html/search/all_13.js +8 -8
- package/SVF-doxygen/html/html/search/all_14.js +2 -2
- package/SVF-doxygen/html/html/search/all_16.js +1 -1
- package/SVF-doxygen/html/html/search/all_17.js +1 -1
- package/SVF-doxygen/html/html/search/all_2.js +2 -3
- package/SVF-doxygen/html/html/search/all_3.js +2 -1
- package/SVF-doxygen/html/html/search/all_6.js +1 -1
- package/SVF-doxygen/html/html/search/all_7.js +7 -7
- package/SVF-doxygen/html/html/search/all_c.js +1 -1
- package/SVF-doxygen/html/html/search/all_d.js +1 -1
- package/SVF-doxygen/html/html/search/all_e.js +6 -6
- package/SVF-doxygen/html/html/search/functions_0.js +3 -3
- package/SVF-doxygen/html/html/search/functions_10.js +2 -2
- package/SVF-doxygen/html/html/search/functions_6.js +7 -7
- package/SVF-doxygen/html/html/search/typedefs_1.js +0 -1
- package/SVF-doxygen/html/html/search/variables_12.js +1 -0
- package/SVF-doxygen/html/html/search/variables_14.js +1 -1
- package/SVF-doxygen/html/html/search/variables_2.js +1 -1
- package/SVF-doxygen/html/html/search/variables_3.js +2 -1
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +3 -3
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ICFG_01_5_01_4.html +18 -18
- package/SVF-doxygen/html/html/svf-ex_8cpp.html +1 -1
- package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +1 -1
- package/include/Graphs/ICFG.h +1 -1
- package/include/Graphs/ICFGEdge.h +39 -17
- package/include/Graphs/ICFGNode.h +1 -1
- package/include/MemoryModel/SVFStatements.h +2 -11
- package/include/SVF-FE/SVFIRBuilder.h +3 -1
- package/include/Util/ExtAPI.h +1 -1
- package/lib/Graphs/ICFG.cpp +22 -7
- package/lib/MemoryModel/SVFIR.cpp +2 -1
- package/lib/MemoryModel/SVFStatements.cpp +6 -6
- package/lib/MemoryModel/SymbolTableInfo.cpp +1 -1
- package/lib/SVF-FE/ICFGBuilder.cpp +8 -3
- package/lib/SVF-FE/SVFIRBuilder.cpp +15 -3
- package/lib/Util/ExtAPI.cpp +0 -1
- package/package.json +1 -1
|
@@ -114,7 +114,7 @@ Static Public Member Functions</h2></td></tr>
|
|
|
114
114
|
struct llvm::DOTGraphTraits< ICFG * ></h3>
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
117
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00482">482</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
118
118
|
</div><h2 class="groupheader">Member Typedef Documentation</h2>
|
|
119
119
|
<a id="a7ef3894da60c3e3350b8d2de3e94a562"></a>
|
|
120
120
|
<h2 class="memtitle"><span class="permalink"><a href="#a7ef3894da60c3e3350b8d2de3e94a562">◆ </a></span>NodeType</h2>
|
|
@@ -128,7 +128,7 @@ struct llvm::DOTGraphTraits< ICFG * ></h3>
|
|
|
128
128
|
</table>
|
|
129
129
|
</div><div class="memdoc">
|
|
130
130
|
|
|
131
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
131
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00485">485</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
132
132
|
|
|
133
133
|
</div>
|
|
134
134
|
</div>
|
|
@@ -157,8 +157,8 @@ struct llvm::DOTGraphTraits< ICFG * ></h3>
|
|
|
157
157
|
</table>
|
|
158
158
|
</div><div class="memdoc">
|
|
159
159
|
|
|
160
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
161
|
-
<div class="fragment"><div class="line"><a name="
|
|
160
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00486">486</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
161
|
+
<div class="fragment"><div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  :</div><div class="line"><a name="l00487"></a><span class="lineno"> 487</span>  DOTGraphTraits<SVFIR*>(isSimple)</div><div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  {</div><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  }</div></div><!-- fragment -->
|
|
162
162
|
</div>
|
|
163
163
|
</div>
|
|
164
164
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
@@ -204,8 +204,8 @@ template<class EdgeIter > </div>
|
|
|
204
204
|
</table>
|
|
205
205
|
</div><div class="memdoc">
|
|
206
206
|
|
|
207
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
208
|
-
<div class="fragment"><div class="line"><a name="
|
|
207
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00592">592</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
208
|
+
<div class="fragment"><div class="line"><a name="l00593"></a><span class="lineno"> 593</span>  {</div><div class="line"><a name="l00594"></a><span class="lineno"> 594</span>  <a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = *(EI.getCurrent());</div><div class="line"><a name="l00595"></a><span class="lineno"> 595</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(edge && <span class="stringliteral">"No edge found!!"</span>);</div><div class="line"><a name="l00596"></a><span class="lineno"> 596</span>  <span class="keywordflow">if</span> (SVFUtil::isa<CallCFGEdge>(edge))</div><div class="line"><a name="l00597"></a><span class="lineno"> 597</span>  <span class="keywordflow">return</span> <span class="stringliteral">"style=solid,color=red"</span>;</div><div class="line"><a name="l00598"></a><span class="lineno"> 598</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (SVFUtil::isa<RetCFGEdge>(edge))</div><div class="line"><a name="l00599"></a><span class="lineno"> 599</span>  <span class="keywordflow">return</span> <span class="stringliteral">"style=solid,color=blue"</span>;</div><div class="line"><a name="l00600"></a><span class="lineno"> 600</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00601"></a><span class="lineno"> 601</span>  <span class="keywordflow">return</span> <span class="stringliteral">"style=solid"</span>;</div><div class="line"><a name="l00602"></a><span class="lineno"> 602</span>  <span class="keywordflow">return</span> <span class="stringliteral">""</span>;</div><div class="line"><a name="l00603"></a><span class="lineno"> 603</span>  }</div><div class="ttc" id="classSVF_1_1ICFGEdge_html"><div class="ttname"><a href="classSVF_1_1ICFGEdge.html">SVF::ICFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#l00044">ICFGEdge.h:44</a></div></div>
|
|
209
209
|
<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>
|
|
210
210
|
</div><!-- fragment -->
|
|
211
211
|
</div>
|
|
@@ -246,12 +246,12 @@ template<class EdgeIter > </div>
|
|
|
246
246
|
</table>
|
|
247
247
|
</div><div class="memdoc">
|
|
248
248
|
|
|
249
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
250
|
-
<div class="fragment"><div class="line"><a name="
|
|
249
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00606">606</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
250
|
+
<div class="fragment"><div class="line"><a name="l00607"></a><span class="lineno"> 607</span>  {</div><div class="line"><a name="l00608"></a><span class="lineno"> 608</span>  <a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = *(EI.getCurrent());</div><div class="line"><a name="l00609"></a><span class="lineno"> 609</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(edge && <span class="stringliteral">"No edge found!!"</span>);</div><div class="line"><a name="l00610"></a><span class="lineno"> 610</span> </div><div class="line"><a name="l00611"></a><span class="lineno"> 611</span>  std::string str;</div><div class="line"><a name="l00612"></a><span class="lineno"> 612</span>  <a class="code" href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">raw_string_ostream</a> rawstr(str);</div><div class="line"><a name="l00613"></a><span class="lineno"> 613</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CallCFGEdge.html">CallCFGEdge</a>* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge))</div><div class="line"><a name="l00614"></a><span class="lineno"> 614</span>  rawstr << dirCall->getCallSite();</div><div class="line"><a name="l00615"></a><span class="lineno"> 615</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1RetCFGEdge.html">RetCFGEdge</a>* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge))</div><div class="line"><a name="l00616"></a><span class="lineno"> 616</span>  rawstr << dirRet->getCallSite();</div><div class="line"><a name="l00617"></a><span class="lineno"> 617</span> </div><div class="line"><a name="l00618"></a><span class="lineno"> 618</span>  <span class="keywordflow">return</span> rawstr.str();</div><div class="line"><a name="l00619"></a><span class="lineno"> 619</span>  }</div><div class="ttc" id="classSVF_1_1ICFGEdge_html"><div class="ttname"><a href="classSVF_1_1ICFGEdge.html">SVF::ICFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#l00044">ICFGEdge.h:44</a></div></div>
|
|
251
251
|
<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>
|
|
252
|
-
<div class="ttc" id="classSVF_1_1CallCFGEdge_html"><div class="ttname"><a href="classSVF_1_1CallCFGEdge.html">SVF::CallCFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#
|
|
252
|
+
<div class="ttc" id="classSVF_1_1CallCFGEdge_html"><div class="ttname"><a href="classSVF_1_1CallCFGEdge.html">SVF::CallCFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#l00165">ICFGEdge.h:165</a></div></div>
|
|
253
253
|
<div class="ttc" id="namespaceSVF_html_a726981481ac082dcda3e4921416b65a0"><div class="ttname"><a href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">SVF::raw_string_ostream</a></div><div class="ttdeci">llvm::raw_string_ostream raw_string_ostream</div><div class="ttdef"><b>Definition:</b> <a href="BasicTypes_8h_source.html#l00100">BasicTypes.h:100</a></div></div>
|
|
254
|
-
<div class="ttc" id="classSVF_1_1RetCFGEdge_html"><div class="ttname"><a href="classSVF_1_1RetCFGEdge.html">SVF::RetCFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#
|
|
254
|
+
<div class="ttc" id="classSVF_1_1RetCFGEdge_html"><div class="ttname"><a href="classSVF_1_1RetCFGEdge.html">SVF::RetCFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#l00211">ICFGEdge.h:211</a></div></div>
|
|
255
255
|
</div><!-- fragment -->
|
|
256
256
|
</div>
|
|
257
257
|
</div>
|
|
@@ -281,8 +281,8 @@ template<class EdgeIter > </div>
|
|
|
281
281
|
|
|
282
282
|
<p>Return name of the graph. </p>
|
|
283
283
|
|
|
284
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
285
|
-
<div class="fragment"><div class="line"><a name="
|
|
284
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00492">492</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
285
|
+
<div class="fragment"><div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  {</div><div class="line"><a name="l00494"></a><span class="lineno"> 494</span>  <span class="keywordflow">return</span> <span class="stringliteral">"ICFG"</span>;</div><div class="line"><a name="l00495"></a><span class="lineno"> 495</span>  }</div></div><!-- fragment -->
|
|
286
286
|
</div>
|
|
287
287
|
</div>
|
|
288
288
|
<a id="aef77eaa614a202f39964d0a0917b5140"></a>
|
|
@@ -319,8 +319,8 @@ template<class EdgeIter > </div>
|
|
|
319
319
|
</table>
|
|
320
320
|
</div><div class="memdoc">
|
|
321
321
|
|
|
322
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
323
|
-
<div class="fragment"><div class="line"><a name="
|
|
322
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00554">554</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
323
|
+
<div class="fragment"><div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  {</div><div class="line"><a name="l00556"></a><span class="lineno"> 556</span>  std::string str;</div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  <a class="code" href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">raw_string_ostream</a> rawstr(str);</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span> </div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span>  <span class="keywordflow">if</span>(SVFUtil::isa<IntraICFGNode>(node))</div><div class="line"><a name="l00560"></a><span class="lineno"> 560</span>  {</div><div class="line"><a name="l00561"></a><span class="lineno"> 561</span>  rawstr << <span class="stringliteral">"color=black"</span>;</div><div class="line"><a name="l00562"></a><span class="lineno"> 562</span>  }</div><div class="line"><a name="l00563"></a><span class="lineno"> 563</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<FunEntryICFGNode>(node))</div><div class="line"><a name="l00564"></a><span class="lineno"> 564</span>  {</div><div class="line"><a name="l00565"></a><span class="lineno"> 565</span>  rawstr << <span class="stringliteral">"color=yellow"</span>;</div><div class="line"><a name="l00566"></a><span class="lineno"> 566</span>  }</div><div class="line"><a name="l00567"></a><span class="lineno"> 567</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<FunExitICFGNode>(node))</div><div class="line"><a name="l00568"></a><span class="lineno"> 568</span>  {</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  rawstr << <span class="stringliteral">"color=green"</span>;</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span>  }</div><div class="line"><a name="l00571"></a><span class="lineno"> 571</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<CallICFGNode>(node))</div><div class="line"><a name="l00572"></a><span class="lineno"> 572</span>  {</div><div class="line"><a name="l00573"></a><span class="lineno"> 573</span>  rawstr << <span class="stringliteral">"color=red"</span>;</div><div class="line"><a name="l00574"></a><span class="lineno"> 574</span>  }</div><div class="line"><a name="l00575"></a><span class="lineno"> 575</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<RetICFGNode>(node))</div><div class="line"><a name="l00576"></a><span class="lineno"> 576</span>  {</div><div class="line"><a name="l00577"></a><span class="lineno"> 577</span>  rawstr << <span class="stringliteral">"color=blue"</span>;</div><div class="line"><a name="l00578"></a><span class="lineno"> 578</span>  }</div><div class="line"><a name="l00579"></a><span class="lineno"> 579</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<GlobalICFGNode>(node))</div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span>  {</div><div class="line"><a name="l00581"></a><span class="lineno"> 581</span>  rawstr << <span class="stringliteral">"color=purple"</span>;</div><div class="line"><a name="l00582"></a><span class="lineno"> 582</span>  }</div><div class="line"><a name="l00583"></a><span class="lineno"> 583</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00584"></a><span class="lineno"> 584</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> && <span class="stringliteral">"no such kind of node!!"</span>);</div><div class="line"><a name="l00585"></a><span class="lineno"> 585</span> </div><div class="line"><a name="l00586"></a><span class="lineno"> 586</span>  rawstr << <span class="stringliteral">""</span>;</div><div class="line"><a name="l00587"></a><span class="lineno"> 587</span> </div><div class="line"><a name="l00588"></a><span class="lineno"> 588</span>  <span class="keywordflow">return</span> rawstr.str();</div><div class="line"><a name="l00589"></a><span class="lineno"> 589</span>  }</div><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>
|
|
324
324
|
<div class="ttc" id="namespaceSVF_html_a726981481ac082dcda3e4921416b65a0"><div class="ttname"><a href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">SVF::raw_string_ostream</a></div><div class="ttdeci">llvm::raw_string_ostream raw_string_ostream</div><div class="ttdef"><b>Definition:</b> <a href="BasicTypes_8h_source.html#l00100">BasicTypes.h:100</a></div></div>
|
|
325
325
|
</div><!-- fragment -->
|
|
326
326
|
</div>
|
|
@@ -359,8 +359,8 @@ template<class EdgeIter > </div>
|
|
|
359
359
|
</table>
|
|
360
360
|
</div><div class="memdoc">
|
|
361
361
|
|
|
362
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
363
|
-
<div class="fragment"><div class="line"><a name="
|
|
362
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00497">497</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
363
|
+
<div class="fragment"><div class="line"><a name="l00498"></a><span class="lineno"> 498</span>  {</div><div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  <span class="keywordflow">return</span> getSimpleNodeLabel(node, graph);</div><div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  }</div></div><!-- fragment -->
|
|
364
364
|
</div>
|
|
365
365
|
</div>
|
|
366
366
|
<a id="a1cf0470d3e9821152416e3bf5236e553"></a>
|
|
@@ -399,8 +399,8 @@ template<class EdgeIter > </div>
|
|
|
399
399
|
|
|
400
400
|
<p>Return the label of an ICFG node. </p>
|
|
401
401
|
|
|
402
|
-
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#
|
|
403
|
-
<div class="fragment"><div class="line"><a name="
|
|
402
|
+
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00503">503</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
403
|
+
<div class="fragment"><div class="line"><a name="l00504"></a><span class="lineno"> 504</span>  {</div><div class="line"><a name="l00505"></a><span class="lineno"> 505</span>  std::string str;</div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span>  <a class="code" href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">raw_string_ostream</a> rawstr(str);</div><div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  rawstr << <span class="stringliteral">"NodeID: "</span> << node->getId() << <span class="stringliteral">"\n"</span>;</div><div class="line"><a name="l00508"></a><span class="lineno"> 508</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1IntraICFGNode.html">IntraICFGNode</a>* bNode = SVFUtil::dyn_cast<IntraICFGNode>(node))</div><div class="line"><a name="l00509"></a><span class="lineno"> 509</span>  {</div><div class="line"><a name="l00510"></a><span class="lineno"> 510</span>  rawstr << <span class="stringliteral">"IntraICFGNode ID: "</span> << bNode->getId() << <span class="stringliteral">" \t"</span>;</div><div class="line"><a name="l00511"></a><span class="lineno"> 511</span>  <a class="code" href="classSVF_1_1SVFIR.html#a6bc360d2604ae4a0af74530b263b10d9">SVFIR::SVFStmtList</a>& edges = SVFIR::getPAG()->getSVFStmtList(bNode);</div><div class="line"><a name="l00512"></a><span class="lineno"> 512</span>  <span class="keywordflow">if</span> (edges.empty()) {</div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span>  rawstr << <a class="code" href="namespaceSVF_1_1SVFUtil.html#a7486fd8e5350879ed1cbd835c0d4e191">value2String</a>(bNode->getInst()) << <span class="stringliteral">" \t"</span>;</div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span>  <span class="keywordflow">for</span> (SVFIR::SVFStmtList::iterator it = edges.begin(), eit = edges.end(); it != eit; ++it)</div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  {</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFStmt.html">PAGEdge</a>* edge = *it;</div><div class="line"><a name="l00518"></a><span class="lineno"> 518</span>  rawstr << edge-><a class="code" href="classSVF_1_1SVFStmt.html#ad0b4dbe87e009518f22360c48b0d0c22">toString</a>();</div><div class="line"><a name="l00519"></a><span class="lineno"> 519</span>  }</div><div class="line"><a name="l00520"></a><span class="lineno"> 520</span>  }</div><div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  rawstr << <span class="stringliteral">" {fun: "</span> << bNode->getFun()->getName() << <span class="stringliteral">"}"</span>;</div><div class="line"><a name="l00522"></a><span class="lineno"> 522</span>  }</div><div class="line"><a name="l00523"></a><span class="lineno"> 523</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1FunEntryICFGNode.html">FunEntryICFGNode</a>* <a class="code" href="cuddInt_8c.html#a936a27e51e66afb57c2b3a12d78a238e">entry</a> = SVFUtil::dyn_cast<FunEntryICFGNode>(node))</div><div class="line"><a name="l00524"></a><span class="lineno"> 524</span>  {</div><div class="line"><a name="l00525"></a><span class="lineno"> 525</span>  rawstr << <a class="code" href="cuddInt_8c.html#a936a27e51e66afb57c2b3a12d78a238e">entry</a>->toString();</div><div class="line"><a name="l00526"></a><span class="lineno"> 526</span>  }</div><div class="line"><a name="l00527"></a><span class="lineno"> 527</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1FunExitICFGNode.html">FunExitICFGNode</a>* <a class="code" href="util_8h.html#a43b6ea6be735bb828bc062c70cadeff8">exit</a> = SVFUtil::dyn_cast<FunExitICFGNode>(node))</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  {</div><div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  rawstr << <a class="code" href="util_8h.html#a43b6ea6be735bb828bc062c70cadeff8">exit</a>->toString();</div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  }</div><div class="line"><a name="l00531"></a><span class="lineno"> 531</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1CallICFGNode.html">CallICFGNode</a>* call = SVFUtil::dyn_cast<CallICFGNode>(node))</div><div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  {</div><div class="line"><a name="l00533"></a><span class="lineno"> 533</span>  rawstr << call->toString();</div><div class="line"><a name="l00534"></a><span class="lineno"> 534</span>  }</div><div class="line"><a name="l00535"></a><span class="lineno"> 535</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1RetICFGNode.html">RetICFGNode</a>* ret = SVFUtil::dyn_cast<RetICFGNode>(node))</div><div class="line"><a name="l00536"></a><span class="lineno"> 536</span>  {</div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  rawstr << ret->toString();</div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  }</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1GlobalICFGNode.html">GlobalICFGNode</a>* glob = SVFUtil::dyn_cast<GlobalICFGNode>(node) )</div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span>  {</div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span>  <a class="code" href="classSVF_1_1SVFIR.html#a6bc360d2604ae4a0af74530b263b10d9">SVFIR::SVFStmtList</a>& edges = SVFIR::getPAG()->getSVFStmtList(glob);</div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span>  <span class="keywordflow">for</span> (SVFIR::SVFStmtList::iterator it = edges.begin(), eit = edges.end(); it != eit; ++it)</div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span>  {</div><div class="line"><a name="l00544"></a><span class="lineno"> 544</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFStmt.html">PAGEdge</a>* edge = *it;</div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span>  rawstr << edge-><a class="code" href="classSVF_1_1SVFStmt.html#ad0b4dbe87e009518f22360c48b0d0c22">toString</a>();</div><div class="line"><a name="l00546"></a><span class="lineno"> 546</span>  }</div><div class="line"><a name="l00547"></a><span class="lineno"> 547</span>  }</div><div class="line"><a name="l00548"></a><span class="lineno"> 548</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00549"></a><span class="lineno"> 549</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(<span class="keyword">false</span> && <span class="stringliteral">"what else kinds of nodes do we have??"</span>);</div><div class="line"><a name="l00550"></a><span class="lineno"> 550</span> </div><div class="line"><a name="l00551"></a><span class="lineno"> 551</span>  <span class="keywordflow">return</span> rawstr.str();</div><div class="line"><a name="l00552"></a><span class="lineno"> 552</span>  }</div><div class="ttc" id="util_8h_html_a43b6ea6be735bb828bc062c70cadeff8"><div class="ttname"><a href="util_8h.html#a43b6ea6be735bb828bc062c70cadeff8">exit</a></div><div class="ttdeci">VOID_OR_INT exit()</div></div>
|
|
404
404
|
<div class="ttc" id="classSVF_1_1SVFIR_html_a6bc360d2604ae4a0af74530b263b10d9"><div class="ttname"><a href="classSVF_1_1SVFIR.html#a6bc360d2604ae4a0af74530b263b10d9">SVF::SVFIR::SVFStmtList</a></div><div class="ttdeci">std::vector< const SVFStmt * > SVFStmtList</div><div class="ttdef"><b>Definition:</b> <a href="SVFIR_8h_source.html#l00056">SVFIR.h:56</a></div></div>
|
|
405
405
|
<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>
|
|
406
406
|
<div class="ttc" id="classSVF_1_1SVFStmt_html_ad0b4dbe87e009518f22360c48b0d0c22"><div class="ttname"><a href="classSVF_1_1SVFStmt.html#ad0b4dbe87e009518f22360c48b0d0c22">SVF::SVFStmt::toString</a></div><div class="ttdeci">virtual const std::string toString() const</div><div class="ttdef"><b>Definition:</b> <a href="SVFStatements_8cpp_source.html#l00061">SVFStatements.cpp:61</a></div></div>
|
|
@@ -300,7 +300,7 @@ Functions</h2></td></tr>
|
|
|
300
300
|
<p>Traverse along VFG </p>
|
|
301
301
|
|
|
302
302
|
<p class="definition">Definition at line <a class="el" href="svf-ex_8cpp_source.html#l00080">80</a> of file <a class="el" href="svf-ex_8cpp_source.html">svf-ex.cpp</a>.</p>
|
|
303
|
-
<div class="fragment"><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* iNode = icfg-><a class="code" href="classSVF_1_1ICFG.html#a5f2c0aaba07d6fdd63058da0fb60ca8b">getICFGNode</a>(inst);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="classSVF_1_1FIFOWorkList.html">FIFOWorkList<const ICFGNode*></a> worklist;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="namespaceSVF.html#af739db846e47ba6b2fd15eaad31ab7fb">Set<const ICFGNode*></a> visited;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(iNode);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">while</span> (!worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a7056704c224dfb4b57287fe90c004aa8">empty</a>())</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* vNode = worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a8fa72918fce7e9c0b2dc34b683a797c6">pop</a>();</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">for</span> (<a class="code" href="classSVF_1_1ICFGNode.html#ac16c5a3227a44d3b9f7c3209156d9df2">ICFGNode::const_iterator</a> it = iNode-><a class="code" href="classSVF_1_1GenericNode.html#aa4f103330118c8976bf95e4bf53416eb">OutEdgeBegin</a>(), eit =</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  iNode-><a class="code" href="classSVF_1_1GenericNode.html#a19a3366fd8a58290d0c740c46c3dcb3d">OutEdgeEnd</a>(); it != eit; ++it)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = *it;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* succNode = edge-><a class="code" href="classSVF_1_1GenericEdge.html#aeaa31a2c8479e831b36ce2e2582ceb86">getDstNode</a>();</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">if</span> (visited.find(succNode) == visited.end())</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  visited.insert(succNode);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(succNode);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> }</div><div class="ttc" id="classSVF_1_1ICFGEdge_html"><div class="ttname"><a href="classSVF_1_1ICFGEdge.html">SVF::ICFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#
|
|
303
|
+
<div class="fragment"><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* iNode = icfg-><a class="code" href="classSVF_1_1ICFG.html#a5f2c0aaba07d6fdd63058da0fb60ca8b">getICFGNode</a>(inst);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="classSVF_1_1FIFOWorkList.html">FIFOWorkList<const ICFGNode*></a> worklist;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="namespaceSVF.html#af739db846e47ba6b2fd15eaad31ab7fb">Set<const ICFGNode*></a> visited;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(iNode);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">while</span> (!worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a7056704c224dfb4b57287fe90c004aa8">empty</a>())</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* vNode = worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a8fa72918fce7e9c0b2dc34b683a797c6">pop</a>();</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">for</span> (<a class="code" href="classSVF_1_1ICFGNode.html#ac16c5a3227a44d3b9f7c3209156d9df2">ICFGNode::const_iterator</a> it = iNode-><a class="code" href="classSVF_1_1GenericNode.html#aa4f103330118c8976bf95e4bf53416eb">OutEdgeBegin</a>(), eit =</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  iNode-><a class="code" href="classSVF_1_1GenericNode.html#a19a3366fd8a58290d0c740c46c3dcb3d">OutEdgeEnd</a>(); it != eit; ++it)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = *it;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* succNode = edge-><a class="code" href="classSVF_1_1GenericEdge.html#aeaa31a2c8479e831b36ce2e2582ceb86">getDstNode</a>();</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">if</span> (visited.find(succNode) == visited.end())</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  visited.insert(succNode);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(succNode);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> }</div><div class="ttc" id="classSVF_1_1ICFGEdge_html"><div class="ttname"><a href="classSVF_1_1ICFGEdge.html">SVF::ICFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#l00044">ICFGEdge.h:44</a></div></div>
|
|
304
304
|
<div class="ttc" id="classSVF_1_1GenericNode_html_aa4f103330118c8976bf95e4bf53416eb"><div class="ttname"><a href="classSVF_1_1GenericNode.html#aa4f103330118c8976bf95e4bf53416eb">SVF::GenericNode::OutEdgeBegin</a></div><div class="ttdeci">iterator OutEdgeBegin()</div><div class="ttdoc">iterators </div><div class="ttdef"><b>Definition:</b> <a href="GenericGraph_8h_source.html#l00202">GenericGraph.h:202</a></div></div>
|
|
305
305
|
<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>
|
|
306
306
|
<div class="ttc" id="classSVF_1_1ICFGNode_html"><div class="ttname"><a href="classSVF_1_1ICFGNode.html">SVF::ICFGNode</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGNode_8h_source.html#l00054">ICFGNode.h:54</a></div></div>
|
|
@@ -67,7 +67,7 @@ $(function() {
|
|
|
67
67
|
</div><!--header-->
|
|
68
68
|
<div class="contents">
|
|
69
69
|
<a href="svf-ex_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> <span class="comment">//===- svf-ex.cpp -- A driver example of SVF-------------------------------------//</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">//</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// SVF: Static Value-Flow Analysis</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// Copyright (C) <2013-> <Yulei Sui></span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">//</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> </div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <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> <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> <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> <span class="comment">// (at your option) any later version.</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <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> <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> <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> <span class="comment">// GNU General Public License for more details.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <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> <span class="comment">// along with this program. If not, see <http://www.gnu.org/licenses/>.</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">//</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">//===-----------------------------------------------------------------------===//</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">/*</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> // A driver program of SVF including usages of SVF APIs</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> //</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"> // Author: Yulei Sui,</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> */</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="LLVMUtil_8h.html">SVF-FE/LLVMUtil.h</a>"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "<a class="code" href="SVFG_8h.html">Graphs/SVFG.h</a>"</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "<a class="code" href="Andersen_8h.html">WPA/Andersen.h</a>"</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "<a class="code" href="SVFIRBuilder_8h.html">SVF-FE/SVFIRBuilder.h</a>"</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include "<a class="code" href="Options_8h.html">Util/Options.h</a>"</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">using namespace </span><a class="code" href="namespacellvm.html">llvm</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">using namespace </span><a class="code" href="namespaceSVF.html">SVF</a>;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">static</span> llvm::cl::opt<std::string> <a class="code" href="svf-ex_8cpp.html#a2d332c504284f0bc181289ee67479845">InputFilename</a>(cl::Positional,</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  llvm::cl::desc(<span class="stringliteral">"<input bitcode>"</span>), llvm::cl::init(<span class="stringliteral">"-"</span>));</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="svf-ex_8cpp.html#ac5b51f055ec3ed000c95a409a73403a7"> 45</a></span> <a class="code" href="namespaceSVF.html#ae941b2925716d8ebe14bf190aa8dfd06">AliasResult</a> <a class="code" href="svf-ex_8cpp.html#ac5b51f055ec3ed000c95a409a73403a7">aliasQuery</a>(<a class="code" href="classSVF_1_1PointerAnalysis.html">PointerAnalysis</a>* pta, <a class="code" href="namespaceSVF.html#a90b263fd2f541eca78135078114cabda">Value</a>* v1, <a class="code" href="namespaceSVF.html#a90b263fd2f541eca78135078114cabda">Value</a>* v2)</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordflow">return</span> pta-><a class="code" href="classSVF_1_1PointerAnalysis.html#abd9da46106d820721a24201caaa164e1">alias</a>(v1,v2);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> }</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="svf-ex_8cpp.html#ae004a620ad67220b6dd8212a2ad625a9"> 53</a></span> std::string <a class="code" href="svf-ex_8cpp.html#ae004a620ad67220b6dd8212a2ad625a9">printPts</a>(<a class="code" href="classSVF_1_1PointerAnalysis.html">PointerAnalysis</a>* pta, <a class="code" href="namespaceSVF.html#a90b263fd2f541eca78135078114cabda">Value</a>* val)</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> {</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  std::string str;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">raw_string_ostream</a> rawstr(str);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <a class="code" href="namespaceSVF.html#a43a65e0d33af3c743294f7a1139d2301">NodeID</a> pNodeId = pta-><a class="code" href="classSVF_1_1PointerAnalysis.html#a240219c2dc4f5cc5f85445e18c79b83b">getPAG</a>()-><a class="code" href="classSVF_1_1IRGraph.html#abffddd41cc308b9b3bd5ad4a7f8f1624">getValueNode</a>(val);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1PointsTo.html">PointsTo</a>& pts = pta-><a class="code" href="classSVF_1_1PointerAnalysis.html#a4dfb43679e9fa794ebad99b6584c32ec">getPts</a>(pNodeId);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">for</span> (<a class="code" href="classSVF_1_1PointsTo_1_1PointsToIterator.html">PointsTo::iterator</a> ii = pts.<a class="code" href="classSVF_1_1PointsTo.html#aa53962e561399bf493d1f2b9137356f6">begin</a>(), ie = pts.<a class="code" href="classSVF_1_1PointsTo.html#a8f741cdffbf3c5fe0f602cdca677dee6">end</a>();</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  ii != ie; ii++)</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  {</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  rawstr << <span class="stringliteral">" "</span> << *ii << <span class="stringliteral">" "</span>;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <a class="code" href="classSVF_1_1SVFVar.html">PAGNode</a>* targetObj = pta-><a class="code" href="classSVF_1_1PointerAnalysis.html#a240219c2dc4f5cc5f85445e18c79b83b">getPAG</a>()-><a class="code" href="classSVF_1_1GenericGraph.html#a43c9c773bfa17abf481c33073e30d01b">getGNode</a>(*ii);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">if</span>(targetObj-><a class="code" href="classSVF_1_1SVFVar.html#a1ace69053c2c4436fd78d5624bd0086a">hasValue</a>())</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  rawstr << <span class="stringliteral">"("</span> <<*targetObj-><a class="code" href="classSVF_1_1SVFVar.html#afaa33caa8d2a306f6741d9d066243e40">getValue</a>() << <span class="stringliteral">")\t "</span>;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  }</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  }</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">return</span> rawstr.str();</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> }</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> </div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="svf-ex_8cpp.html#af45b449c07f1c975eea45d40d1cc37f6"> 80</a></span> <span class="keywordtype">void</span> <a class="code" href="svf-ex_8cpp.html#af45b449c07f1c975eea45d40d1cc37f6">traverseOnICFG</a>(<a class="code" href="classSVF_1_1ICFG.html">ICFG</a>* icfg, <span class="keyword">const</span> <a class="code" href="namespaceSVF.html#a7875172ff434b2210eea7cecfbbd959e">Instruction</a>* inst)</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* iNode = icfg-><a class="code" href="classSVF_1_1ICFG.html#a5f2c0aaba07d6fdd63058da0fb60ca8b">getICFGNode</a>(inst);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="classSVF_1_1FIFOWorkList.html">FIFOWorkList<const ICFGNode*></a> worklist;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="namespaceSVF.html#af739db846e47ba6b2fd15eaad31ab7fb">Set<const ICFGNode*></a> visited;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(iNode);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">while</span> (!worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a7056704c224dfb4b57287fe90c004aa8">empty</a>())</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* vNode = worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a8fa72918fce7e9c0b2dc34b683a797c6">pop</a>();</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">for</span> (<a class="code" href="classSVF_1_1ICFGNode.html#ac16c5a3227a44d3b9f7c3209156d9df2">ICFGNode::const_iterator</a> it = iNode-><a class="code" href="classSVF_1_1GenericNode.html#aa4f103330118c8976bf95e4bf53416eb">OutEdgeBegin</a>(), eit =</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  iNode-><a class="code" href="classSVF_1_1GenericNode.html#a19a3366fd8a58290d0c740c46c3dcb3d">OutEdgeEnd</a>(); it != eit; ++it)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = *it;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <a class="code" href="classSVF_1_1ICFGNode.html">ICFGNode</a>* succNode = edge-><a class="code" href="classSVF_1_1GenericEdge.html#aeaa31a2c8479e831b36ce2e2582ceb86">getDstNode</a>();</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">if</span> (visited.find(succNode) == visited.end())</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  visited.insert(succNode);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(succNode);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> }</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="svf-ex_8cpp.html#a210d797e39e39071d420ba450727d6e4"> 108</a></span> <span class="keywordtype">void</span> <a class="code" href="svf-ex_8cpp.html#a210d797e39e39071d420ba450727d6e4">traverseOnVFG</a>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFG.html">SVFG</a>* vfg, <a class="code" href="namespaceSVF.html#a90b263fd2f541eca78135078114cabda">Value</a>* val)</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> {</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <a class="code" href="classSVF_1_1SVFIR.html">SVFIR</a>* pag = SVFIR::getPAG();</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="classSVF_1_1SVFVar.html">PAGNode</a>* pNode = pag-><a class="code" href="classSVF_1_1GenericGraph.html#a43c9c773bfa17abf481c33073e30d01b">getGNode</a>(pag-><a class="code" href="classSVF_1_1IRGraph.html#abffddd41cc308b9b3bd5ad4a7f8f1624">getValueNode</a>(val));</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1VFGNode.html">VFGNode</a>* vNode = vfg-><a class="code" href="classSVF_1_1SVFG.html#a8e7a945f4266e8dc7dcfff2ad6494bfb">getDefSVFGNode</a>(pNode);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <a class="code" href="classSVF_1_1FIFOWorkList.html">FIFOWorkList<const VFGNode*></a> worklist;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="namespaceSVF.html#af739db846e47ba6b2fd15eaad31ab7fb">Set<const VFGNode*></a> visited;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(vNode);</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordflow">while</span> (!worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a7056704c224dfb4b57287fe90c004aa8">empty</a>())</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1VFGNode.html">VFGNode</a>* vNode = worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#a8fa72918fce7e9c0b2dc34b683a797c6">pop</a>();</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">for</span> (<a class="code" href="classSVF_1_1VFGNode.html#a3c558955f60c237c558d8faafed781e8">VFGNode::const_iterator</a> it = vNode-><a class="code" href="classSVF_1_1GenericNode.html#aa4f103330118c8976bf95e4bf53416eb">OutEdgeBegin</a>(), eit =</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  vNode-><a class="code" href="classSVF_1_1GenericNode.html#a19a3366fd8a58290d0c740c46c3dcb3d">OutEdgeEnd</a>(); it != eit; ++it)</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <a class="code" href="classSVF_1_1VFGEdge.html">VFGEdge</a>* edge = *it;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <a class="code" href="classSVF_1_1VFGNode.html">VFGNode</a>* succNode = edge-><a class="code" href="classSVF_1_1GenericEdge.html#aeaa31a2c8479e831b36ce2e2582ceb86">getDstNode</a>();</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordflow">if</span> (visited.find(succNode) == visited.end())</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  visited.insert(succNode);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  worklist.<a class="code" href="classSVF_1_1FIFOWorkList.html#ad4c6a48b60c870d63049fe7272cc7eb8">push</a>(succNode);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  }</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  }</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">for</span>(<a class="code" href="namespaceSVF.html#af739db846e47ba6b2fd15eaad31ab7fb">Set<const VFGNode*>::const_iterator</a> it = visited.begin(), eit = visited.end(); it!=eit; ++it)</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  {</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1VFGNode.html">VFGNode</a>* node = *it;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  }</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> }</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="svf-ex_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627"> 145</a></span> <span class="keywordtype">int</span> <a class="code" href="svf-ex_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv)</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> {</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordtype">int</span> arg_num = 0;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordtype">char</span> **arg_value = <span class="keyword">new</span> <span class="keywordtype">char</span>*[argc];</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  std::vector<std::string> moduleNameVec;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <a class="code" href="namespaceSVF_1_1SVFUtil.html#a62ca9a79ce7b6960e3fc42d8b183bd50">SVFUtil::processArguments</a>(argc, argv, arg_num, arg_value, moduleNameVec);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  cl::ParseCommandLineOptions(arg_num, arg_value,</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="stringliteral">"Whole Program Points-to Analysis\n"</span>);</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  </div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">if</span> (Options::WriteAnder == <span class="stringliteral">"ir_annotator"</span>)</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  LLVMModuleSet::getLLVMModuleSet()->preProcessBCs(moduleNameVec);</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  }</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> </div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <a class="code" href="classSVF_1_1SVFModule.html">SVFModule</a>* svfModule = LLVMModuleSet::getLLVMModuleSet()->buildSVFModule(moduleNameVec);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  svfModule-><a class="code" href="classSVF_1_1SVFModule.html#aa03ab5272652290f30870c6e2d053d98">buildSymbolTableInfo</a>();</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <a class="code" href="classSVF_1_1SVFIRBuilder.html">SVFIRBuilder</a> builder;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <a class="code" href="classSVF_1_1SVFIR.html">SVFIR</a>* pag = builder.<a class="code" href="classSVF_1_1SVFIRBuilder.html#aa6d56f9580f76fd09d25ce6cf7541e98">build</a>(svfModule);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <a class="code" href="classSVF_1_1Andersen.html">Andersen</a>* ander = AndersenWaveDiff::createAndersenWaveDiff(pag);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> </div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> </div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <a class="code" href="classSVF_1_1PTACallGraph.html">PTACallGraph</a>* callgraph = ander-><a class="code" href="classSVF_1_1PointerAnalysis.html#a7c9b7e5fe37ae31ba84d167945ca57df">getPTACallGraph</a>();</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> </div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <a class="code" href="classSVF_1_1ICFG.html">ICFG</a>* icfg = pag-><a class="code" href="classSVF_1_1SVFIR.html#aa1943d53e75aef9b014953143c6894da">getICFG</a>();</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <a class="code" href="classSVF_1_1VFG.html">VFG</a>* vfg = <span class="keyword">new</span> <a class="code" href="classSVF_1_1VFG.html">VFG</a>(callgraph);</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <a class="code" href="classSVF_1_1SVFGBuilder.html">SVFGBuilder</a> svfBuilder(<span class="keyword">true</span>);</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <a class="code" href="classSVF_1_1SVFG.html">SVFG</a>* svfg = svfBuilder.<a class="code" href="classSVF_1_1SVFGBuilder.html#a54a713e3989597b11cee70864d0197bd">buildFullSVFG</a>(ander);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span> </div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span> </div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="comment">// clean up memory</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keyword">delete</span> vfg;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keyword">delete</span> svfg;</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  AndersenWaveDiff::releaseAndersenWaveDiff();</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  SVFIR::releaseSVFIR();</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span> </div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  LLVMModuleSet::getLLVMModuleSet()->dumpModulesToFile(<span class="stringliteral">".svf.bc"</span>);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <a class="code" href="classSVF_1_1LLVMModuleSet.html#a2f8e91c075d90be66412a079fe73e936">SVF::LLVMModuleSet::releaseLLVMModuleSet</a>();</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span> </div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  llvm::llvm_shutdown();</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span> }</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span> </div><div class="ttc" id="Andersen_8h_html"><div class="ttname"><a href="Andersen_8h.html">Andersen.h</a></div></div>
|
|
70
|
-
<div class="ttc" id="classSVF_1_1ICFGEdge_html"><div class="ttname"><a href="classSVF_1_1ICFGEdge.html">SVF::ICFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#
|
|
70
|
+
<div class="ttc" id="classSVF_1_1ICFGEdge_html"><div class="ttname"><a href="classSVF_1_1ICFGEdge.html">SVF::ICFGEdge</a></div><div class="ttdef"><b>Definition:</b> <a href="ICFGEdge_8h_source.html#l00044">ICFGEdge.h:44</a></div></div>
|
|
71
71
|
<div class="ttc" id="classSVF_1_1VFG_html"><div class="ttname"><a href="classSVF_1_1VFG.html">SVF::VFG</a></div><div class="ttdef"><b>Definition:</b> <a href="VFG_8h_source.html#l00050">VFG.h:50</a></div></div>
|
|
72
72
|
<div class="ttc" id="namespacellvm_html"><div class="ttname"><a href="namespacellvm.html">llvm</a></div><div class="ttdef"><b>Definition:</b> <a href="CHG_8h_source.html#l00328">CHG.h:328</a></div></div>
|
|
73
73
|
<div class="ttc" id="classSVF_1_1PointerAnalysis_html_a4dfb43679e9fa794ebad99b6584c32ec"><div class="ttname"><a href="classSVF_1_1PointerAnalysis.html#a4dfb43679e9fa794ebad99b6584c32ec">SVF::PointerAnalysis::getPts</a></div><div class="ttdeci">virtual const PointsTo & getPts(NodeID ptr)=0</div><div class="ttdoc">Get points-to targets of a pointer. It needs to be implemented in child class. </div></div>
|
package/include/Graphs/ICFG.h
CHANGED
|
@@ -128,7 +128,7 @@ protected:
|
|
|
128
128
|
/// Add control-flow edges for top level pointers
|
|
129
129
|
//@{
|
|
130
130
|
ICFGEdge* addIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode);
|
|
131
|
-
ICFGEdge* addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition,
|
|
131
|
+
ICFGEdge* addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition, s64_t branchCondVal);
|
|
132
132
|
ICFGEdge* addCallEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Instruction* cs);
|
|
133
133
|
ICFGEdge* addRetEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Instruction* cs);
|
|
134
134
|
//@}
|
|
@@ -34,6 +34,8 @@ namespace SVF
|
|
|
34
34
|
{
|
|
35
35
|
|
|
36
36
|
class ICFGNode;
|
|
37
|
+
class CallPE;
|
|
38
|
+
class RetPE;
|
|
37
39
|
|
|
38
40
|
/*!
|
|
39
41
|
* Interprocedural control-flow and value-flow edge, representing the control- and value-flow dependence between two nodes
|
|
@@ -112,15 +114,8 @@ class IntraCFGEdge : public ICFGEdge
|
|
|
112
114
|
{
|
|
113
115
|
|
|
114
116
|
public:
|
|
115
|
-
/// the first element is a boolean (for if/else) or numeric condition value (for switch)
|
|
116
|
-
/// the second element is the value when this condition should hold to execute this CFGEdge.
|
|
117
|
-
/// e.g., Inst1: br %cmp label 0, label 1, Inst2 is label 0 and Inst 3 is label 1;
|
|
118
|
-
/// for edge between Inst1 and Inst 2, the first element is %cmp and second element is 0
|
|
119
|
-
|
|
120
|
-
typedef std::pair<const Value*,NodeID> BranchCondition;
|
|
121
|
-
|
|
122
117
|
/// Constructor
|
|
123
|
-
IntraCFGEdge(ICFGNode* s, ICFGNode* d): ICFGEdge(s,d,IntraCF)
|
|
118
|
+
IntraCFGEdge(ICFGNode* s, ICFGNode* d): ICFGEdge(s,d,IntraCF), conditionVar(nullptr), branchCondVal(0)
|
|
124
119
|
{
|
|
125
120
|
}
|
|
126
121
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
@@ -139,23 +134,31 @@ public:
|
|
|
139
134
|
}
|
|
140
135
|
//@}
|
|
141
136
|
|
|
142
|
-
const
|
|
143
|
-
return
|
|
137
|
+
const Value* getCondition() const{
|
|
138
|
+
return conditionVar;
|
|
144
139
|
}
|
|
145
140
|
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
const s64_t getSuccessorCondValue() const{
|
|
142
|
+
assert(getCondition() && "this is not a conditional branch edge");
|
|
143
|
+
return branchCondVal;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
void setBranchCondition(const Value* c, s64_t bVal){
|
|
147
|
+
conditionVar = c;
|
|
148
|
+
branchCondVal = bVal;
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
virtual const std::string toString() const;
|
|
151
152
|
|
|
152
153
|
private:
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
/// conditionVar is a boolean (for if/else) or numeric condition variable (for switch)
|
|
155
|
+
/// branchCondVal is the value when this condition should hold to execute this CFGEdge.
|
|
156
|
+
/// e.g., Inst1: br %cmp label 0, label 1, Inst2 is label 0 and Inst 3 is label 1;
|
|
157
|
+
/// for edge between Inst1 and Inst 2, the first element is %cmp and second element is 0
|
|
158
|
+
const Value* conditionVar;
|
|
159
|
+
s64_t branchCondVal;
|
|
155
160
|
};
|
|
156
161
|
|
|
157
|
-
|
|
158
|
-
|
|
159
162
|
/*!
|
|
160
163
|
* Call ICFG edge representing parameter passing/return from a caller to a callee
|
|
161
164
|
*/
|
|
@@ -164,6 +167,7 @@ class CallCFGEdge : public ICFGEdge
|
|
|
164
167
|
|
|
165
168
|
private:
|
|
166
169
|
const Instruction* cs;
|
|
170
|
+
std::vector<const CallPE*> callPEs;
|
|
167
171
|
public:
|
|
168
172
|
/// Constructor
|
|
169
173
|
CallCFGEdge(ICFGNode* s, ICFGNode* d, const Instruction* c):
|
|
@@ -175,6 +179,14 @@ public:
|
|
|
175
179
|
{
|
|
176
180
|
return cs;
|
|
177
181
|
}
|
|
182
|
+
/// Add call parameter edge to this CallCFGEdge
|
|
183
|
+
inline void addCallPE(const CallPE* callPE){
|
|
184
|
+
callPEs.push_back(callPE);
|
|
185
|
+
}
|
|
186
|
+
/// Add get parameter edge to this CallCFGEdge
|
|
187
|
+
inline const std::vector<const CallPE*>& getCallPEs() const{
|
|
188
|
+
return callPEs;
|
|
189
|
+
}
|
|
178
190
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
179
191
|
//@{
|
|
180
192
|
static inline bool classof(const CallCFGEdge *)
|
|
@@ -201,10 +213,11 @@ class RetCFGEdge : public ICFGEdge
|
|
|
201
213
|
|
|
202
214
|
private:
|
|
203
215
|
const Instruction* cs;
|
|
216
|
+
const RetPE* retPE;
|
|
204
217
|
public:
|
|
205
218
|
/// Constructor
|
|
206
219
|
RetCFGEdge(ICFGNode* s, ICFGNode* d, const Instruction* c):
|
|
207
|
-
ICFGEdge(s,d,RetCF),cs(c)
|
|
220
|
+
ICFGEdge(s,d,RetCF),cs(c),retPE(nullptr)
|
|
208
221
|
{
|
|
209
222
|
}
|
|
210
223
|
/// Return callsite ID
|
|
@@ -212,6 +225,15 @@ public:
|
|
|
212
225
|
{
|
|
213
226
|
return cs;
|
|
214
227
|
}
|
|
228
|
+
/// Add call parameter edge to this CallCFGEdge
|
|
229
|
+
inline void addRetPE(const RetPE* ret){
|
|
230
|
+
assert(retPE==nullptr && "we can only have one retPE for each RetCFGEdge");
|
|
231
|
+
retPE = ret;
|
|
232
|
+
}
|
|
233
|
+
/// Add get parameter edge to this CallCFGEdge
|
|
234
|
+
inline const RetPE* getRetPE() const{
|
|
235
|
+
return retPE;
|
|
236
|
+
}
|
|
215
237
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
216
238
|
//@{
|
|
217
239
|
static inline bool classof(const RetCFGEdge *)
|
|
@@ -639,15 +639,6 @@ public:
|
|
|
639
639
|
{
|
|
640
640
|
return SVFStmt::getDstNode();
|
|
641
641
|
}
|
|
642
|
-
/// Return the position of this op
|
|
643
|
-
const u32_t getOpPos(const SVFVar* op) const{
|
|
644
|
-
for(u32_t i = 0; i < getOpVarNum(); i++){
|
|
645
|
-
if(getOpVar(i)==op)
|
|
646
|
-
return i;
|
|
647
|
-
}
|
|
648
|
-
assert(false && "this operand not found!");
|
|
649
|
-
abort();
|
|
650
|
-
}
|
|
651
642
|
|
|
652
643
|
NodeID getOpVarID(u32_t pos) const;
|
|
653
644
|
NodeID getResID() const;
|
|
@@ -718,8 +709,8 @@ public:
|
|
|
718
709
|
}
|
|
719
710
|
|
|
720
711
|
/// Return the corresponding ICFGNode of this operand
|
|
721
|
-
inline const ICFGNode* getOpICFGNode(
|
|
722
|
-
return opICFGNodes.at(
|
|
712
|
+
inline const ICFGNode* getOpICFGNode(u32_t op_idx) const{
|
|
713
|
+
return opICFGNodes.at(op_idx);
|
|
723
714
|
}
|
|
724
715
|
|
|
725
716
|
/// Return true if this is a phi at the function exit
|