Hi everyone. I want to get the llvm IR from the C source code by LLVM-GCC. But I am not familiar with those command line arguments. Can anyone give me a guidance? Thank you very much for any help. Good luck. -- Best regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081225/2e138eeb/attachment.html>
Please run. $ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc $ llvm-dis < hello.bc > hello.ll The first command is to generate a byte code and second is to translate the bytecode to a readable form. Thanks! From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Alex.Wang Sent: Wednesday, December 24, 2008 10:31 PM To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] how to get the llvm IR from C source code? Hi everyone. I want to get the llvm IR from the C source code by LLVM-GCC. But I am not familiar with those command line arguments. Can anyone give me a guidance? Thank you very much for any help. Good luck. -- Best regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081224/0c3a0aa3/attachment.html>
Keun Soo Yim wrote:> > Please run… > > $ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc > > $ llvm-dis < hello.bc > hello.ll > > The first command is to generate a byte code > > and second is to translate the bytecode to a readable form. >llvm-gcc can emit the textual form directly too: llvm-gcc -O2 -emit-llvm hello.c -S -o hello.ll llvm-gcc -O2 -emit-llvm hello.c -S -o - the latter will print it to standard out.> Thanks! > > *From:* llvmdev-bounces at cs.uiuc.edu > [mailto:llvmdev-bounces at cs.uiuc.edu] *On Behalf Of *Alex.Wang > *Sent:* Wednesday, December 24, 2008 10:31 PM > *To:* llvmdev at cs.uiuc.edu > *Subject:* [LLVMdev] how to get the llvm IR from C source code? > > Hi everyone. > I want to get the llvm IR from the C source code by LLVM-GCC. But I am > not familiar with those command line arguments. > Can anyone give me a guidance? Thank you very much for any help. > Good luck. > > -- > Best regards. > > ------------------------------------------------------------------------ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >