Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see the llvm intermediate representation in Xcode

Tags:

xcode

llvm

clang

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 ?

like image 538
David Lehavi Avatar asked Dec 21 '09 09:12

David Lehavi


1 Answers

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.

like image 57
Daniel Dunbar Avatar answered Sep 21 '22 19:09

Daniel Dunbar