||04-05-2013 07:00 PM
The upside to using LLVM/Clang have to do with a) giving GCC some competition and b) giving different/better error reporting than GCC. Clang seems to be a nice C compiler that can compile a lot of open-source C programs. For now, the memory usage of Clang is not the miserable mess that gcc can be a times. LLVM/Clang is distributed under a BSD-style license, and that's part of the reason that FreeBSD uses it. Apple seems to like it because it can work on Objective-C without relying on GCC, but how that propagates to C/C++ is something I don't know.
The downside is in the programs that Clang can't compile, and that happens quite a bit on the C++ side. The results of doing, say, a Clang build of Xfce on top of a gcc-built GTK+ might not go very well. LLVM/Clang and GCC are simply targeting different parts of the C++ standards for improvement. Additionally, almost all of the open-source programs meant to be compiled on Linux were meant to be compiled using GCC. Whether such a program compiles using Clang depends on a) the upstream maintainer caring whether his/her program builds with Clang, b) that the program was written with portability in mind, and/or c) sheer luck that Clang chose to support the same quirks that GCC did.
LLVM/Clang is compelling on FreeBSD and can do a full `make world`, which would be the loose equivalent of taking the source code to the Slackware a, ap, d, and k disk sets, with parts of l and n thrown in there; then building all of it at once. I think that GCC is deprecated at this point for doing such a build. But keep in mind that the FreeBSD folks want to keep GPLv3 out of this world, and most of the GNU programs in the FreeBSD base are the last versions for which they were GPLv2 or lower. In particular, this means that GCC is 4.2.0 in FreeBSD, and that was a long time ago. They have plenty of incentive to make sure that Clang works on FreeBSD before GCC 4.2.0 becomes too obsolete to compile cutting-edge programs.
As for Linux in general, though, getting everything to work with Clang should be done on a case-by-case basis. Try it, though! For the C programs at least, a program should either build or not build. I haven't seen a case where a C program will build without errors under Clang and then do the wrong thing, but you still might watch for such cases.