开发者

How do I see the llvm intermediate representation in Xcode

I'm compiling with clang-l开发者_高级运维lvm 1.0 on Xcode 3.2.1

I want to see LLVM's intermediate representation. How do I do this ?


Xcode does have support for syntax highlighting the LLVM intermediate representation, but this representation is internal to the compiler (and changes frequently) and Xcode doesn't have any UI for talking to the compiler to show the intermediate representation in the UI. This would be an interesting feature request though, have you consider filing it with Apple?

If you just want to see it, you can do so manually by taking the compile command from the build log, and adding '-emit-llvm -S -o /tmp/t.ll' to the end. Now you can open /tmp/t.ll in Xcode and see the LLVM IR for that one file.


Per LLVM's site, I would add -emit-llvm to the compiler options. Xcode does not provide UI for showing the representation (yet).


This should work in Xcode (just tested):

-S -emit-llvm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜