[LLVMdev] Fail to get IR for a linux driver program

Nick Lewycky nicholas at mxc.ca
Sat Aug 7 11:56:28 PDT 2010

θΏͺ 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.


More information about the llvm-dev mailing list