Hi Bill,<div><br></div><div>Thanks for reply! I am sorry I didn't express my question clearly.</div><div><br></div><div>Examples may explain well. Now I am trying to analyze the data flow of programs. I first compile the C code to bitcode, and then apply our algorithm to the bitcode to find the dependency between statements. But as to C++ code, there are class, vector, reference, I may need to revise my algorithm to analyze bitcode from C++.</div>
<div> <br clear="all"><div>I am trying to find such difference of bitcode between C and C++.</div><div><br>--<br>Best Regards,<br>Fei Jia</div><div><br></div><br>
<br><br><div class="gmail_quote">On Wed, Sep 21, 2011 at 6:26 PM, Bill Wendling <span dir="ltr"><<a href="mailto:wendling@apple.com">wendling@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sep 21, 2011, at 6:13 PM, Fei Jia wrote:<br>
<br>
> Could anybody provide me some links or pages or infos of the difference of bitcodes of C and C++? We have implemented an optimization pass on bitcode generated from C, and we are trying to find out whether it will work on bitcode from C++. Thanks!<br>
><br>
</div>Hi Fei,<br>
<br>
There isn't a difference in the bitcode format of a C as opposed to a C++ program. There are differences in how functions are linked, but that's a function of the language and not the bitcode. E.g., if you want to call a C function from C++, you need to do this:<br>
<br>
extern "C" {<br>
void foo();<br>
}<br>
<br>
void bar() {<br>
foo();<br>
}<br>
<font color="#888888"><br>
-bw<br>
<br>
<br>
</font></blockquote></div><br></div>