3

I have a question concerning the LLVM compiler:

I would like to use it to compile my Objective-C source code for Mac and iOS and from their release notes it seems that LLVM is stable enough for using this.

Having made good experiences with the LLVM I would also like to use it to compile C++ or Objective-C++. However it is not clear to me if I should still use the hybrid LLVM-GCC compiler (the GCC parser and the LLVM code generator) or the pure LLVM compiler.

I am also unsure about the new C++ standard library and if I should use it and how I would make the transition from GNU's libstdc++.

The Questions

  1. Which compiler would one use today to generate fast production quality code from C++: the LLVM-GCC hybrid compiler or pure LLVM?
  2. Should one migrate the C++ standard library from GNU's libstdc++ to the new libc++ library created by the LLVM project?

Any comments and hints are appreciated.

Community
  • 1
  • 1
GorillaPatch
  • 5,007
  • 1
  • 39
  • 56
  • I am feeling a bit unsure about LLVM for arm as there were some crashes when using this code on armv6 devices. – GorillaPatch Apr 07 '11 at 21:39
  • I was amazed to learn this tidbit: http://stackoverflow.com/questions/5524906/gcc-thumb-support-can-it-be-turned-off-for-just-one-module/5525372#comment-6276408 – Fattie Apr 07 '11 at 21:46
  • Note that this is an old question. Apple's current developer tools use LLVM; GCC is gone. – Kristopher Johnson Jul 25 '12 at 11:48

2 Answers2

7

Several questions asked here, I'll try to answer all of them.

  1. There is no "pure LLVM compiler". LLVM is a set of libraries which do code optimization and code generation . There are several C/C++ frontends which can be hooked to LLVM. Among them are clang and llvm-gcc. See http://llvm.org/ for more information about various components of LLVM Compiler Infrastructure. As written at http://llvm.org/docs/ReleaseNotes.html, llvm-gcc is EOL since LLVM 2.9 release, so you'd better use clang, because it will certainly be developed and maintained in the future.
  2. libc++ is still in development, so for production you should use vendor-provided C++ (libstdc++ in your case).
Anton Korobeynikov
  • 9,074
  • 25
  • 28
0

Remember, all this stuff is changing, so benchmarks gets easily outdated.

I've found following report interesting, not only as a kind of benchmark, but it seems showing some LLVM vs GCC compiler differences : Clang/LLVM Maturity Evaluation Report by Dominic Fandrey

Grzegorz Wierzowiecki
  • 10,545
  • 9
  • 50
  • 88