<br><br>Hi,<br><br> I am playing around a bit of with clang and have hit a problem. For a Clang input with if statement, I am trying to obtain line number of beginning of Then statement and then print it out. But I am not able to make sense of the output. Can you please help. In a nutshell I am trying to get presumed loc from sourceloc of Then statement. For the following input, its printing 6 and 12 instead of 4 and 8.<br>
<br><br>Detailed description can be found at<br><br><a href="http://stackoverflow.com/questions/17582628/not-able-to-print-correct-line-numbers-for-then-part-of-if-statement-clang">http://stackoverflow.com/questions/17582628/not-able-to-print-correct-line-numbers-for-then-part-of-if-statement-clang</a><br>
<br>My code (250 lines, but important stuff is between lines 100 and 105) is at<br><a href="http://pastebin.com/txF9Bwa4">http://pastebin.com/txF9Bwa4</a><br><br><br>My input is <a href="http://pastebin.com/hF5yMMAz">http://pastebin.com/hF5yMMAz</a><br>
<blockquote>
<pre><code>1 #include <stdio.h>
2 int func (int abc, int xyz) {
3 if (abc-1)
4 {
5 printf ("1\n");
6 }
7 if (abc-2)
8 {
9 printf ("2\n");
</code></pre>
<p>10 }</p>
<p>11</p>
<p>12 return 0;</p>
<p>13 }</p>
</blockquote><br><br>Please let me know if you need any additional information. Compilation instructions are in the stackoverflow link.<br>Thanks very much <br>--raghuram<br>