Fei Jia
2011-Sep-22 01:13 UTC
[LLVMdev] question on difference of bitcode between C and C++
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! -- Best Regards, Fei Jia -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110921/9305a3cc/attachment.html>
Bill Wendling
2011-Sep-22 01:26 UTC
[LLVMdev] question on difference of bitcode between C and C++
On Sep 21, 2011, at 6:13 PM, Fei Jia wrote:> 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! >Hi Fei, 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: extern "C" { void foo(); } void bar() { foo(); } -bw
Fei Jia
2011-Sep-22 02:01 UTC
[LLVMdev] question on difference of bitcode between C and C++
Hi Bill, Thanks for reply! I am sorry I didn't express my question clearly. 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++. I am trying to find such difference of bitcode between C and C++. -- Best Regards, Fei Jia On Wed, Sep 21, 2011 at 6:26 PM, Bill Wendling <wendling at apple.com> wrote:> On Sep 21, 2011, at 6:13 PM, Fei Jia wrote: > > > 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! > > > Hi Fei, > > 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: > > extern "C" { > void foo(); > } > > void bar() { > foo(); > } > > -bw > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110921/2f130848/attachment.html>
Possibly Parallel Threads
- [LLVMdev] question on difference of bitcode between C and C++
- [LLVMdev] question on difference of bitcode between C and C++
- [LLVMdev] There are compiling errors when converting bytecode to c by LLC
- [LLVMdev] question on difference of bitcode between C and C++
- [LLVMdev] There are compiling errors when converting bytecode to c by LLC