There are several reasons why I am currently not considering the transition to Clang (although I would love to switch to it): - Clang (LLVM compiler 2.x) is only integrated by default in Xcode 4 which has not been released yet. I guess it might be possible to use Clang in Xcode 3.2 and Xcode 3.1. - Clang is a new compiler and the C++ support is really new and might contain bugs. Moreover Apple recommends to use llvm-gcc 4.2. The default compiler with Xcode 4 will be llvm-gcc 4.2 and not clang. - Our code is mostly written in C++. The LLVM 1.0 compiler included in Xcode 3.2.x can't compile C++ code and falls back to llvm-gcc 4.2.So even If we switch to LLVM 1.0, it is very likely that we will get the exact same issues as if we switch to llvm-gcc 4.2. - Some of our code (or third party code we use) contains gcc predefined macro and we also have some third party libraries. With llvm-gcc we would keep the gcc parser which means less compatibility issues. - I am not sure if clang can generate code that runs on 10.5. Alexandre> On Sat, 24 Jul 2010 13:41:42 +0200 > Alexandre Colucci <timac at timac.org> wrote: > >> Hi, >> >> I am currently studying the possibility to make the transition from >> gcc 4.2 to llvm-gcc 4.2 for the projects I am working on. > > Since you are switching compilers, why not switch to clang instead of > llvm-gcc? > > Best regards, > --Edwin >
On Jul 24, 2010, at 10:15 AM, Alexandre Colucci wrote:> > There are several reasons why I am currently not considering the transition to Clang (although I would love to switch to it): > > - Clang (LLVM compiler 2.x) is only integrated by default in Xcode 4 which has not been released yet. I guess it might be possible to use Clang in Xcode 3.2 and Xcode 3.1.Right.> - Clang is a new compiler and the C++ support is really new and might contain bugs. Moreover Apple recommends to use llvm-gcc 4.2. The default compiler with Xcode 4 will be llvm-gcc 4.2 and not clang.Clang is actually going to be the default for new projects, but you're right that llvm-gcc is much more mature.> - Our code is mostly written in C++. The LLVM 1.0 compiler included in Xcode 3.2.x can't compile C++ code and falls back to llvm-gcc 4.2.So even If we switch to LLVM 1.0, it is very likely that we will get the exact same issues as if we switch to llvm-gcc 4.2. > - Some of our code (or third party code we use) contains gcc predefined macro and we also have some third party libraries. With llvm-gcc we would keep the gcc parser which means less compatibility issues.Clang should be very compatible with GCC and its extensions, except that it is more pedantic about enforcing C++ language rules. One major feature not supported by clang yet is "microsoft/codewarrier style inline assembly". Since you are apparently using this, Clang sounds like a non-starter for you for now.> - I am not sure if clang can generate code that runs on 10.5.It can, but it does not support powerpc (llvm-gcc does). -Chris
On 24 juil. 2010, at 20:29, Chris Lattner wrote:>> - I am not sure if clang can generate code that runs on 10.5. > > It can, but it does not support powerpc (llvm-gcc does).Really? I couldn't find any Apple documentation that mentions this. Also we have built powerpc code with the clang "LLVM compiler 1.5" and it does run on powerpc. Should we use the llvm-gcc compiler for the powerpc architecture instead? Thomas