David Lehavi
David Lehavi

Reputation: 1198

How do I see the llvm intermediate representation in Xcode

I'm compiling with clang-llvm 1.0 on Xcode 3.2.1

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

Upvotes: 8

Views: 2737

Answers (3)

marc hoffman
marc hoffman

Reputation: 635

This should work in Xcode (just tested):

-S -emit-llvm

Upvotes: -2

Daniel Dunbar
Daniel Dunbar

Reputation: 3615

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.

Upvotes: 6

refulgentis
refulgentis

Reputation: 2635

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

Upvotes: 0

Related Questions