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

Jonathan gamma_chen at yahoo.com.tw
Fri Apr 5 19:52:09 PDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130406/743a5f00/attachment.html>


More information about the llvm-dev mailing list