svf-tools 1.0.408 → 1.0.409
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.
|
@@ -1685,7 +1685,7 @@ Additional Inherited Members</h2></td></tr>
|
|
|
1685
1685
|
<p>Remove callBlockNode to retBlockNode intraICFGEdge since we found at least one inter procedural edge </p>
|
|
1686
1686
|
|
|
1687
1687
|
<p class="definition">Definition at line <a class="el" href="ICFG_8cpp_source.html#l00426">426</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
1688
|
-
<div class="fragment"><div class="line"><a name="l00427"></a><span class="lineno"> 427</span> {</div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  PTACallGraph::CallEdgeMap::const_iterator iter = callgraph-><a class="code" href="classSVF_1_1PTACallGraph.html#ad49fa2a288945f6910deb11acdf6a42d">getIndCallMap</a>().begin();</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  PTACallGraph::CallEdgeMap::const_iterator eiter = callgraph-><a class="code" href="classSVF_1_1PTACallGraph.html#ad49fa2a288945f6910deb11acdf6a42d">getIndCallMap</a>().end();</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <span class="keywordflow">for</span> (; iter != eiter; iter++)</div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  {</div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CallICFGNode.html">CallICFGNode</a>* callBlock = iter->first;</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  <span class="keyword">const</span> <a class="code" href="namespaceSVF.html#a7875172ff434b2210eea7cecfbbd959e">Instruction</a>* cs = callBlock-><a class="code" href="classSVF_1_1CallICFGNode.html#a674753d5ca0fbe28674acb25291f2bcf">getCallSite</a>();</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(callBlock-><a class="code" href="classSVF_1_1CallICFGNode.html#aa11226a2e4fa6a7b1d78006cc8ca0518">isIndirectCall</a>() && <span class="stringliteral">"this is not an indirect call?"</span>);</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1PTACallGraph.html#a5f5a5ec7e707a21994d301cc07d32a5a">PTACallGraph::FunctionSet</a> & functions = iter->second;</div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  <span class="keywordflow">for</span> (PTACallGraph::FunctionSet::const_iterator func_iter = functions.begin(); func_iter != functions.end(); func_iter++)</div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  {</div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFFunction.html">SVFFunction</a>* callee = *func_iter;</div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <a class="code" href="classSVF_1_1CallICFGNode.html">CallICFGNode</a>* callBlockNode = <a class="code" href="classSVF_1_1ICFG.html#adc66b547720b9271e6805edea0b9d01f">getCallICFGNode</a>(cs);</div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <a class="code" href="classSVF_1_1RetICFGNode.html">RetICFGNode</a>* retBlockNode = <a class="code" href="classSVF_1_1ICFG.html#a66cb50d8c176f800f06d9cb8924eb896">getRetICFGNode</a>(cs);</div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <a class="code" href="classSVF_1_1FunEntryICFGNode.html">FunEntryICFGNode</a>* calleeEntryNode = <a class="code" href="classSVF_1_1ICFG.html#acc261924103bd0c357acd3acfa6cf38a">getFunEntryBlock</a>(callee);</div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  <a class="code" href="classSVF_1_1FunExitICFGNode.html">FunExitICFGNode</a>* calleeExitNode = <a class="code" href="classSVF_1_1ICFG.html#a22d7f37a0cb2df90f73c1f2e3eaa71c6">getFunExitBlock</a>(callee);</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <span class="keywordflow">if</span>(<a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* callEdge = <a class="code" href="classSVF_1_1ICFG.html#abde033687317d47909ee45db7501723f">addCallEdge</a>(callBlockNode, calleeEntryNode, cs)){</div><div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFStmt.html">SVFStmt</a> *stmt : callBlockNode-><a class="code" href="classSVF_1_1ICFGNode.html#a6c68f52dd90728073fb79141df9b0661">getSVFStmts</a>())</div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  {</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <span class="keywordflow">if</span>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CallPE.html">CallPE</a> *callPE = SVFUtil::dyn_cast<CallPE>(stmt)){</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="keywordflow">if</span>(callPE->getFunEntryICFGNode() == calleeEntryNode)</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  SVFUtil::cast<CallCFGEdge>(callEdge)->addCallPE(callPE);</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  }</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  }</div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  }</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  <span class="keywordflow">if</span>(<a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* retEdge = <a class="code" href="classSVF_1_1ICFG.html#a4a44849b596c89ab14d2e5f18366e848">addRetEdge</a>(calleeExitNode, retBlockNode, cs)){</div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFStmt.html">SVFStmt</a> *stmt : retBlockNode-><a class="code" href="classSVF_1_1ICFGNode.html#a6c68f52dd90728073fb79141df9b0661">getSVFStmts</a>())</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  {</div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  <span class="keywordflow">if</span>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1RetPE.html">RetPE</a> *retPE = SVFUtil::dyn_cast<RetPE>(stmt)){</div><div class="line"><a name="l00456"></a><span class="lineno"> 456</span>  <span class="keywordflow">if</span>(retPE->getFunExitICFGNode() == calleeExitNode)</div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  SVFUtil::cast<RetCFGEdge>(retEdge)->addRetPE(retPE);</div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  }</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  }</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  }</div><div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  <span class="keywordflow">if</span> (<a class="code" href="namespaceSVF_1_1SVFUtil.html#a22ef185e767ff76c098e75126c885400">isExtCall</a>(callee))</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  <a class="code" href="classSVF_1_1ICFG.html#adafd8bbb91507a9a78a3f16305812afc">addIntraEdge</a>(calleeEntryNode, calleeExitNode); </div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span> </div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span>  <span class="keywordflow">if</span>(<a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = <a class="code" href="classSVF_1_1ICFG.html#aa662baae5682ef6ec5084fa4147c9709">hasIntraICFGEdge</a>(callBlockNode,retBlockNode, <a class="code" href="classSVF_1_1ICFGEdge.html#a395c34788e98950bc43e8cb44313e429acb8fba7c61b08ec952f1b65643d7a84b">ICFGEdge::IntraCF</a>))</div><div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  <a class="code" href="classSVF_1_1ICFG.html#a534625b10673efe5b0f344bfebf9b3cf">removeICFGEdge</a>(edge);</div><div class="line"><a name="l00468"></a><span class="lineno"> 468</span>  }</div><div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  }</div><div class="line"><a name="l00470"></a><span class="lineno"> 470</span>  <span class="comment">// dump ICFG</span></div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1Options.html#aea29a835c54fab800117e57de00e0b1e">Options::DumpICFG</a>){</div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span>  <a class="code" href="classSVF_1_1ICFG.html#a999956500bbd605326531480546db9ba">dump</a>(<span class="stringliteral">"icfg_final"</span>);</div><div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  }</div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span> }</div><div class="ttc" id="classSVF_1_1ICFG_html_abde033687317d47909ee45db7501723f"><div class="ttname"><a href="classSVF_1_1ICFG.html#abde033687317d47909ee45db7501723f">SVF::ICFG::addCallEdge</a></div><div class="ttdeci">ICFGEdge * addCallEdge(ICFGNode *srcNode, ICFGNode *dstNode, const Instruction *cs)</div><div class="ttdef"><b>Definition:</b> <a href="ICFG_8cpp_source.html#l00375">ICFG.cpp:375</a></div></div>
|
|
1688
|
+
<div class="fragment"><div class="line"><a name="l00427"></a><span class="lineno"> 427</span> {</div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  PTACallGraph::CallEdgeMap::const_iterator iter = callgraph-><a class="code" href="classSVF_1_1PTACallGraph.html#ad49fa2a288945f6910deb11acdf6a42d">getIndCallMap</a>().begin();</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  PTACallGraph::CallEdgeMap::const_iterator eiter = callgraph-><a class="code" href="classSVF_1_1PTACallGraph.html#ad49fa2a288945f6910deb11acdf6a42d">getIndCallMap</a>().end();</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <span class="keywordflow">for</span> (; iter != eiter; iter++)</div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  {</div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1CallICFGNode.html">CallICFGNode</a>* callBlock = iter->first;</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  <span class="keyword">const</span> <a class="code" href="namespaceSVF.html#a7875172ff434b2210eea7cecfbbd959e">Instruction</a>* cs = callBlock-><a class="code" href="classSVF_1_1CallICFGNode.html#a674753d5ca0fbe28674acb25291f2bcf">getCallSite</a>();</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  <a class="code" href="util_8h.html#a07d17d6d5d1074c0969bc5d3c3d1d84a">assert</a>(callBlock-><a class="code" href="classSVF_1_1CallICFGNode.html#aa11226a2e4fa6a7b1d78006cc8ca0518">isIndirectCall</a>() && <span class="stringliteral">"this is not an indirect call?"</span>);</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1PTACallGraph.html#a5f5a5ec7e707a21994d301cc07d32a5a">PTACallGraph::FunctionSet</a> & functions = iter->second;</div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  <span class="keywordflow">for</span> (PTACallGraph::FunctionSet::const_iterator func_iter = functions.begin(); func_iter != functions.end(); func_iter++)</div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  {</div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFFunction.html">SVFFunction</a>* callee = *func_iter;</div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <a class="code" href="classSVF_1_1CallICFGNode.html">CallICFGNode</a>* callBlockNode = <a class="code" href="classSVF_1_1ICFG.html#adc66b547720b9271e6805edea0b9d01f">getCallICFGNode</a>(cs);</div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <a class="code" href="classSVF_1_1RetICFGNode.html">RetICFGNode</a>* retBlockNode = <a class="code" href="classSVF_1_1ICFG.html#a66cb50d8c176f800f06d9cb8924eb896">getRetICFGNode</a>(cs);</div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  <span class="keywordflow">if</span> (<a class="code" href="namespaceSVF_1_1SVFUtil.html#a22ef185e767ff76c098e75126c885400">isExtCall</a>(callee))</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <a class="code" href="classSVF_1_1ICFG.html#adafd8bbb91507a9a78a3f16305812afc">addIntraEdge</a>(callBlockNode, retBlockNode);</div><div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  <a class="code" href="classSVF_1_1FunEntryICFGNode.html">FunEntryICFGNode</a>* calleeEntryNode = <a class="code" href="classSVF_1_1ICFG.html#acc261924103bd0c357acd3acfa6cf38a">getFunEntryBlock</a>(callee);</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <a class="code" href="classSVF_1_1FunExitICFGNode.html">FunExitICFGNode</a>* calleeExitNode = <a class="code" href="classSVF_1_1ICFG.html#a22d7f37a0cb2df90f73c1f2e3eaa71c6">getFunExitBlock</a>(callee);</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="keywordflow">if</span>(<a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* callEdge = <a class="code" href="classSVF_1_1ICFG.html#abde033687317d47909ee45db7501723f">addCallEdge</a>(callBlockNode, calleeEntryNode, cs)){</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFStmt.html">SVFStmt</a> *stmt : callBlockNode-><a class="code" href="classSVF_1_1ICFGNode.html#a6c68f52dd90728073fb79141df9b0661">getSVFStmts</a>())</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  {</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  <span class="keywordflow">if</span>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1CallPE.html">CallPE</a> *callPE = SVFUtil::dyn_cast<CallPE>(stmt)){</div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  <span class="keywordflow">if</span>(callPE->getFunEntryICFGNode() == calleeEntryNode)</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  SVFUtil::cast<CallCFGEdge>(callEdge)->addCallPE(callPE);</div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  }</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  }</div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  }</div><div class="line"><a name="l00456"></a><span class="lineno"> 456</span>  <span class="keywordflow">if</span>(<a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* retEdge = <a class="code" href="classSVF_1_1ICFG.html#a4a44849b596c89ab14d2e5f18366e848">addRetEdge</a>(calleeExitNode, retBlockNode, cs)){</div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="classSVF_1_1SVFStmt.html">SVFStmt</a> *stmt : retBlockNode-><a class="code" href="classSVF_1_1ICFGNode.html#a6c68f52dd90728073fb79141df9b0661">getSVFStmts</a>())</div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  {</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  <span class="keywordflow">if</span>(<span class="keyword">const</span> <a class="code" href="classSVF_1_1RetPE.html">RetPE</a> *retPE = SVFUtil::dyn_cast<RetPE>(stmt)){</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  <span class="keywordflow">if</span>(retPE->getFunExitICFGNode() == calleeExitNode)</div><div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  SVFUtil::cast<RetCFGEdge>(retEdge)->addRetPE(retPE);</div><div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  }</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  }</div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  }</div><div class="line"><a name="l00465"></a><span class="lineno"> 465</span> </div><div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  <span class="keywordflow">if</span>(<a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = <a class="code" href="classSVF_1_1ICFG.html#aa662baae5682ef6ec5084fa4147c9709">hasIntraICFGEdge</a>(callBlockNode,retBlockNode, <a class="code" href="classSVF_1_1ICFGEdge.html#a395c34788e98950bc43e8cb44313e429acb8fba7c61b08ec952f1b65643d7a84b">ICFGEdge::IntraCF</a>))</div><div class="line"><a name="l00468"></a><span class="lineno"> 468</span>  <a class="code" href="classSVF_1_1ICFG.html#a534625b10673efe5b0f344bfebf9b3cf">removeICFGEdge</a>(edge);</div><div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  }</div><div class="line"><a name="l00470"></a><span class="lineno"> 470</span> </div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  }</div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span>  }</div><div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  <span class="comment">// dump ICFG</span></div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  <span class="keywordflow">if</span> (<a class="code" href="classSVF_1_1Options.html#aea29a835c54fab800117e57de00e0b1e">Options::DumpICFG</a>){</div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  <a class="code" href="classSVF_1_1ICFG.html#a999956500bbd605326531480546db9ba">dump</a>(<span class="stringliteral">"icfg_final"</span>);</div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  }</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span> }</div><div class="ttc" id="classSVF_1_1ICFG_html_abde033687317d47909ee45db7501723f"><div class="ttname"><a href="classSVF_1_1ICFG.html#abde033687317d47909ee45db7501723f">SVF::ICFG::addCallEdge</a></div><div class="ttdeci">ICFGEdge * addCallEdge(ICFGNode *srcNode, ICFGNode *dstNode, const Instruction *cs)</div><div class="ttdef"><b>Definition:</b> <a href="ICFG_8cpp_source.html#l00375">ICFG.cpp:375</a></div></div>
|
|
1689
1689
|
<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>
|
|
1690
1690
|
<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#l00534">SVFStatements.h:534</a></div></div>
|
|
1691
1691
|
<div class="ttc" id="classSVF_1_1PTACallGraph_html_ad49fa2a288945f6910deb11acdf6a42d"><div class="ttname"><a href="classSVF_1_1PTACallGraph.html#ad49fa2a288945f6910deb11acdf6a42d">SVF::PTACallGraph::getIndCallMap</a></div><div class="ttdeci">CallEdgeMap & getIndCallMap()</div><div class="ttdoc">Get callees from an indirect callsite. </div><div class="ttdef"><b>Definition:</b> <a href="PTACallGraph_8h_source.html#l00280">PTACallGraph.h:280</a></div></div>
|
|
@@ -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#l00485">485</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#l00488">488</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#l00489">489</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
161
|
+
<div class="fragment"><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  :</div><div class="line"><a name="l00490"></a><span class="lineno"> 490</span>  DOTGraphTraits<SVFIR*>(isSimple)</div><div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  {</div><div class="line"><a name="l00492"></a><span class="lineno"> 492</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#l00549">549</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
208
|
+
<div class="fragment"><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>  <a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = *(EI.getCurrent());</div><div class="line"><a name="l00552"></a><span class="lineno"> 552</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="l00553"></a><span class="lineno"> 553</span>  <span class="keywordflow">if</span> (SVFUtil::isa<CallCFGEdge>(edge))</div><div class="line"><a name="l00554"></a><span class="lineno"> 554</span>  <span class="keywordflow">return</span> <span class="stringliteral">"style=solid,color=red"</span>;</div><div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (SVFUtil::isa<RetCFGEdge>(edge))</div><div class="line"><a name="l00556"></a><span class="lineno"> 556</span>  <span class="keywordflow">return</span> <span class="stringliteral">"style=solid,color=blue"</span>;</div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  <span class="keywordflow">return</span> <span class="stringliteral">"style=solid"</span>;</div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span>  <span class="keywordflow">return</span> <span class="stringliteral">""</span>;</div><div class="line"><a name="l00560"></a><span class="lineno"> 560</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,8 +246,8 @@ 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#l00563">563</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
250
|
+
<div class="fragment"><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>  <a class="code" href="classSVF_1_1ICFGEdge.html">ICFGEdge</a>* edge = *(EI.getCurrent());</div><div class="line"><a name="l00566"></a><span class="lineno"> 566</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="l00567"></a><span class="lineno"> 567</span> </div><div class="line"><a name="l00568"></a><span class="lineno"> 568</span>  std::string str;</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  <a class="code" href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">raw_string_ostream</a> rawstr(str);</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</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="l00571"></a><span class="lineno"> 571</span>  rawstr << dirCall->getCallSite();</div><div class="line"><a name="l00572"></a><span class="lineno"> 572</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="l00573"></a><span class="lineno"> 573</span>  rawstr << dirRet->getCallSite();</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">return</span> rawstr.str();</div><div class="line"><a name="l00576"></a><span class="lineno"> 576</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
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="ttdoc">LLVM outputs. </div><div class="ttdef"><b>Definition:</b> <a href="Util_2BasicTypes_8h_source.html#l00095">BasicTypes.h:95</a></div></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#l00495">495</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
285
|
+
<div class="fragment"><div class="line"><a name="l00496"></a><span class="lineno"> 496</span>  {</div><div class="line"><a name="l00497"></a><span class="lineno"> 497</span>  <span class="keywordflow">return</span> <span class="stringliteral">"ICFG"</span>;</div><div class="line"><a name="l00498"></a><span class="lineno"> 498</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#l00511">511</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
323
|
+
<div class="fragment"><div class="line"><a name="l00512"></a><span class="lineno"> 512</span>  {</div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span>  std::string str;</div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  <a class="code" href="namespaceSVF.html#a726981481ac082dcda3e4921416b65a0">raw_string_ostream</a> rawstr(str);</div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span> </div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  <span class="keywordflow">if</span>(SVFUtil::isa<IntraICFGNode>(node))</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span>  {</div><div class="line"><a name="l00518"></a><span class="lineno"> 518</span>  rawstr << <span class="stringliteral">"color=black"</span>;</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>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<FunEntryICFGNode>(node))</div><div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  {</div><div class="line"><a name="l00522"></a><span class="lineno"> 522</span>  rawstr << <span class="stringliteral">"color=yellow"</span>;</div><div class="line"><a name="l00523"></a><span class="lineno"> 523</span>  }</div><div class="line"><a name="l00524"></a><span class="lineno"> 524</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<FunExitICFGNode>(node))</div><div class="line"><a name="l00525"></a><span class="lineno"> 525</span>  {</div><div class="line"><a name="l00526"></a><span class="lineno"> 526</span>  rawstr << <span class="stringliteral">"color=green"</span>;</div><div class="line"><a name="l00527"></a><span class="lineno"> 527</span>  }</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<CallICFGNode>(node))</div><div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  {</div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  rawstr << <span class="stringliteral">"color=red"</span>;</div><div class="line"><a name="l00531"></a><span class="lineno"> 531</span>  }</div><div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<RetICFGNode>(node))</div><div class="line"><a name="l00533"></a><span class="lineno"> 533</span>  {</div><div class="line"><a name="l00534"></a><span class="lineno"> 534</span>  rawstr << <span class="stringliteral">"color=blue"</span>;</div><div class="line"><a name="l00535"></a><span class="lineno"> 535</span>  }</div><div class="line"><a name="l00536"></a><span class="lineno"> 536</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(SVFUtil::isa<GlobalICFGNode>(node))</div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  {</div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  rawstr << <span class="stringliteral">"color=purple"</span>;</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  }</div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00541"></a><span class="lineno"> 541</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="l00542"></a><span class="lineno"> 542</span> </div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span>  rawstr << <span class="stringliteral">""</span>;</div><div class="line"><a name="l00544"></a><span class="lineno"> 544</span> </div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span>  <span class="keywordflow">return</span> rawstr.str();</div><div class="line"><a name="l00546"></a><span class="lineno"> 546</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="ttdoc">LLVM outputs. </div><div class="ttdef"><b>Definition:</b> <a href="Util_2BasicTypes_8h_source.html#l00095">BasicTypes.h:95</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#l00500">500</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
363
|
+
<div class="fragment"><div class="line"><a name="l00501"></a><span class="lineno"> 501</span>  {</div><div class="line"><a name="l00502"></a><span class="lineno"> 502</span>  <span class="keywordflow">return</span> getSimpleNodeLabel(node, graph);</div><div class="line"><a name="l00503"></a><span class="lineno"> 503</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#l00506">506</a> of file <a class="el" href="ICFG_8cpp_source.html">ICFG.cpp</a>.</p>
|
|
403
|
+
<div class="fragment"><div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  {</div><div class="line"><a name="l00508"></a><span class="lineno"> 508</span>  <span class="keywordflow">return</span> node->toString();</div><div class="line"><a name="l00509"></a><span class="lineno"> 509</span>  }</div></div><!-- fragment -->
|
|
404
404
|
</div>
|
|
405
405
|
</div>
|
|
406
406
|
<hr/>The documentation for this struct was generated from the following file:<ul>
|
package/lib/Graphs/ICFG.cpp
CHANGED
|
@@ -438,33 +438,36 @@ void ICFG::updateCallGraph(PTACallGraph* callgraph)
|
|
|
438
438
|
const SVFFunction* callee = *func_iter;
|
|
439
439
|
CallICFGNode* callBlockNode = getCallICFGNode(cs);
|
|
440
440
|
RetICFGNode* retBlockNode = getRetICFGNode(cs);
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
441
|
+
/// if this is an external function (no function body), connect calleeEntryNode to calleeExitNode
|
|
442
|
+
if (isExtCall(callee))
|
|
443
|
+
addIntraEdge(callBlockNode, retBlockNode);
|
|
444
|
+
else {
|
|
445
|
+
FunEntryICFGNode* calleeEntryNode = getFunEntryBlock(callee);
|
|
446
|
+
FunExitICFGNode* calleeExitNode = getFunExitBlock(callee);
|
|
447
|
+
if(ICFGEdge* callEdge = addCallEdge(callBlockNode, calleeEntryNode, cs)){
|
|
448
|
+
for (const SVFStmt *stmt : callBlockNode->getSVFStmts())
|
|
449
|
+
{
|
|
450
|
+
if(const CallPE *callPE = SVFUtil::dyn_cast<CallPE>(stmt)){
|
|
451
|
+
if(callPE->getFunEntryICFGNode() == calleeEntryNode)
|
|
452
|
+
SVFUtil::cast<CallCFGEdge>(callEdge)->addCallPE(callPE);
|
|
453
|
+
}
|
|
449
454
|
}
|
|
450
455
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
if(ICFGEdge* retEdge = addRetEdge(calleeExitNode, retBlockNode, cs)){
|
|
457
|
+
for (const SVFStmt *stmt : retBlockNode->getSVFStmts())
|
|
458
|
+
{
|
|
459
|
+
if(const RetPE *retPE = SVFUtil::dyn_cast<RetPE>(stmt)){
|
|
460
|
+
if(retPE->getFunExitICFGNode() == calleeExitNode)
|
|
461
|
+
SVFUtil::cast<RetCFGEdge>(retEdge)->addRetPE(retPE);
|
|
462
|
+
}
|
|
458
463
|
}
|
|
459
464
|
}
|
|
465
|
+
|
|
466
|
+
/// Remove callBlockNode to retBlockNode intraICFGEdge since we found at least one inter procedural edge
|
|
467
|
+
if(ICFGEdge* edge = hasIntraICFGEdge(callBlockNode,retBlockNode, ICFGEdge::IntraCF))
|
|
468
|
+
removeICFGEdge(edge);
|
|
460
469
|
}
|
|
461
|
-
/// if this is an external function (no function body), connect calleeEntryNode to calleeExitNode
|
|
462
|
-
if (isExtCall(callee))
|
|
463
|
-
addIntraEdge(calleeEntryNode, calleeExitNode);
|
|
464
470
|
|
|
465
|
-
/// Remove callBlockNode to retBlockNode intraICFGEdge since we found at least one inter procedural edge
|
|
466
|
-
if(ICFGEdge* edge = hasIntraICFGEdge(callBlockNode,retBlockNode, ICFGEdge::IntraCF))
|
|
467
|
-
removeICFGEdge(edge);
|
|
468
471
|
}
|
|
469
472
|
}
|
|
470
473
|
// dump ICFG
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.409",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|