[LLVMdev] How to compile object C with clang into llvm IR?

Tyler Hardin tghardin1 at catamount.wcu.edu
Fri Apr 5 20:05:39 PDT 2013


Look up --emit-llvm. I think it has to be used with -c.
On Apr 5, 2013 10:55 PM, "Jonathan" <gamma_chen at yahoo.com.tw> wrote:

> Following came from tools/clang/test/CodeGenObjC/message-arrays.m. But I
> don't know how to compile it at terminal command since no clang_cc1
> executable file. Can some one help me? I am writing the llvm backend
> document --http://jonathan2251.github.com/lbd/index.html now. I use
> "clang -c hello.cpp -emit-llvm" to compile C++ but don't know how to
> compile Object-C.
>
> // RUN: %clang_cc1 -emit-llvm -o %t %s
>
> void f0(id a) {
>  // This should have an implicit cast
>  [ a print: "hello" ];
> }
>
> @interface A
> -(void) m: (int) arg0, ...;
> @end
>
> int f1(A *a) {
>  // This should also get an implicit cast (for the vararg)
>  [a m: 1, "test"];
> }
>
> Jonathan
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130405/b4afd6cf/attachment.html>


More information about the llvm-dev mailing list