<p class="MsoNormal">Is there any inter-procedural analysis that could tell me if
some BasicBlock Y is guaranteed to execute based on my knowledge that
BasicBlock X will execute? For example:</p>
<p class="MsoNormal"><br></p><p class="MsoNormal">extern int x;</p>
<p class="MsoNormal">void foo() { }</p>
<p class="MsoNormal">int main() {</p>
<p class="MsoNormal"> if (x) {</p>
<p class="MsoNormal"> foo();</p>
<p class="MsoNormal"> } else {</p>
<p class="MsoNormal"> foo();</p>
<p class="MsoNormal" style="text-indent:.5in">}</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I want to be told that the entry block of foo is guaranteed
to be executed since I know the entry block of main is guaranteed to be
executed. Basically that all paths from X to program termination go through Y at some point. Please ignore the folding of identical branches and function in-lining, I want to use this type of analysis in the general case.</p>
<p class="MsoNormal"><br></p><p class="MsoNormal">Thanks,</p><p class="MsoNormal">-Stephen</p>