LLVM integrates better with tools, has an amazing static analyzer, and AFAIK generates code that is on average as fast and small as GCC. (I believe who wins depends on the code.)
LLVM integrates better with tools, has an amazing static analyzer, and AFAIK generates code that is on average as fast and small as GCC. (I believe who wins depends on the code.)
That said I use both, and at work we test our code against both toolchains (and some other compilers aswell). The static analyser in Clang is a welcome addition and the error diagnostics/reporting is top notch so it certainly has strong features even though it falls behind GCC in code optimization.
However, GCC 4.7's just around the corner and I haven't tried that yet...
Though, admittedly, if speed is an issue you probably have already manually loop-unrolled and used the gcc compiler intrinsics.
A) it's proprietary, I have no interest in relying on a proprietary toolchain (and from what I gather neither does the company I work for)
B) it supports a very limited range of cpu architectures, not only is it directly tailored for Intel cpu's it even has a history of selecting poor code paths for AMD cpu's.
As for manual loop unrolling, for alot of code PGO does a great job here by unrolling based on the statistics gathered during the first pass. In fact GCC's pgo seems to do a better job than ICC's pgo implementation, ICC's lto beats GCC's on the other hand, and of course ICC does a better job at vectorization and has better optimized math functions.
Yawn. LLVM seems nice. When it competes on merit in the big world instead of in a sandbox people will care more I guess. Last I tried building my C++ project with it, it puked on the STL headers.
Use what you like.
I find the rest of our comment somewhat derogatory towards LLVM and the kind of things you can do with it today, it's already at a point where it provides comparable compatibility and features as the many different GCC versions you'll find on various unix systems. Somehow every time I read something about LLVM here people start to rant about some incompatibility they've seen that GCC doesn't have, as if GCC is the epitome of compilers. From experience I can tell you LLVM shows better compatibility with current GCC versions, than many older GCC versions that are still shipped with some Linux distro's.
Eventually, unless GCC makes a giant leap forwards in all the ways set forth in this article, LLVM is going to replace it, sooner or later. I think that's what the guy above me was about when he asked why GCC is still relevant today.
That said, having a C++ compiler designed for humans and not robots is to be commended.
So no, I don't really "care" about it. Fix the compiler to actually be better for my purposes than what I have before telling me what I should use or care about please. And when you do, I promise I'll join your little cult, OK?
Define 'current development environment', both at home and at work GCC is the primary development environment for me as far as compilers go, I'm not waiting for GCC 5.0, I am using GCC 4.6 today.
>comparable compatibility
Is a very fuzzy statement, having compiled lots of open source projects under many different compilers there are certainly many projects out there which fails to compile with Clang (but it's certainly making fast progress in compability). Granted most if not all of these packages were written against GCC and some of them may use GCC extensions Clang/LLVM does not yet (or in some cases won't) support or some other quirks which all compilers have in their implementations of different standards.
>Eventually, unless GCC makes a giant leap forwards in all the ways set forth in this article, LLVM is going to replace it, sooner or later. I think that's what the guy above me was about when he asked why GCC is still relevant today.
Been hearing that ever since LLVM (and later Clang) surfaced as an option, I'd say you'll have to set your hopes for 'later' (Clang's been around what? 4 or 5 years now?). Personally I can't see why anyone other than someone with an agenda would want either compiler to disappear, competition means better tools for us end users, no matter which toolchain we prefer.
As for modularization, that has been an ongoing task in GCC long before this particular mailing list discussion, and I think it will continue as it has now in small steps.
LLVM is not as good as GCC in some ways, but evidently better and more future-proof in others. Unless GCC evolves in the same direction as Clang + LLVM, the latter will close the gap sooner or later and basically deprecate GCC. I'm not advocating this should happen, not even predicting it will, just observing GCC is starting to fall behind in exactly the areas that make LLVM so useful.
> Been hearing that ever since LLVM (and later Clang) surfaced as an option, I'd say you'll have to set your hopes for 'later' (Clang's been around what? 4 or 5 years now?)
Well, it already replaced GCC on probably one of the most popular platforms for current development, so you can't say it isn't getting anywhere, can you? It's going to get interesting when we see some kind of Gentoo fork that uses it by default. That would be a good indication it is very nearly mature enough to challenge GCC on all aspects.
Incidentally the owner of that platform is also the main (sole corporate?) driving force of Clang/LLVM and has a history of wanting to incorporate open source into their proprietary tools which doesn't work with GPL licenced code. In other words saying that Apple is switching to Clang/LLVM makes no bigger point in my opinion than saying that FSF uses GCC.
Also, I think you should invest a little time finding out what LLVM is used for besides as the backend for the compiler Apple uses. Apple maybe the only heavyweight driving the development of Clang/LLVM, but it is definitely not the only one using or profiting from it.
LLVM is where the innovative ecosystem lives now, even if GCC is more reliable for just churning out fast C code.