Hi all, I used llvm-gcc (llvm version 2.7) to transform a linux network driver program (for example: linux/drivers/net/zoro8390.c) to the IR form with the command: "llvm-gcc -D__GNUCC -E -emit-llvm -I../../include zorro8390.c -S" under the drivers/net directory. It didn't give the resulting IR (i.e. zoro8390.s) and it printed out a modified program, which it looked like the definitions for functions, macros and other stuff from other files are all added or expanded for my target program. How could I get the desired IR for the driver? Thank you very much! Regards, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100807/2f8f3708/attachment.html>
迪 wrote:> Hi all, > > I used llvm-gcc (llvm version 2.7) to transform a linux network driver > program (for example: linux/drivers/net/zoro8390.c) to the IR form with > the command: "llvm-gcc -D__GNUCC -E -emit-llvm -I../../include > zorro8390.c -S" under the drivers/net directory. It didn't give the > resulting IR (i.e. zoro8390.s) and it printed out a modified program, > which it looked like the definitions for functions, macros and other > stuff from other files are all added or expanded for my target program.That's what the -E flag does. It preprocesses the file.> How could I get the desired IR for the driver? Thank you very much!You have the two other flags that matter, -S and -emit-llvm. Try removing -E and see whether that works. Nick
Anton Korobeynikov
2010-Aug-07 19:33 UTC
[LLVMdev] Fail to get IR for a linux driver program
> added or expanded for my target program. How could I get the desired IR for > the driver? Thank you very much!Remove the -E cmdline option -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Thank you very much for both of you! I tried to compile the program without the -E and then I got lots of compile errors of missing headers and definitions. I'm trying to eliminate them now. Regards, Daniel 2010/8/7 Anton Korobeynikov <anton at korobeynikov.info>> > added or expanded for my target program. How could I get the desired IR > for > > the driver? Thank you very much! > Remove the -E cmdline option > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100807/a351b9c2/attachment.html>
Reasonably Related Threads
- [LLVMdev] Fail to get IR for a linux driver program
- [LLVMdev] Dragonegg + IR + llc = Dragonegg directly
- [LLVMdev] ARM c++ exceptions handling not working with clang/llvm-3.2?
- [LLVMdev] [cfe-dev] Reminder: LLVM 2.9 Branching in One Week
- [LLVMdev] ARM c++ exceptions handling not working with clang/llvm-3.2?