4 ms·
Preprocessing with clang would be very tricky in a system that uses gcc for the compilation proper (which we do). Clang adds its own predefined #defines, which
by andralex 13y ago
Preprocessing with clang would be very tricky in a system that uses gcc for the compilation proper (which we do). Clang adds its own predefined #defines, which may change the resulting code.
- DannyBee 13y agoSure, if you are stuck with GCC, and have no plans to move, it makes sense to improve GCC's preprocessor for a number of reasons (warp produces cacheable artifacts, etc). But it's actually not that tricky, since you can just change the defines it makes (after all, if you are maintaining your own toolchain, you are maintaining your own toolchain). In fact, you are already doing it with warp to emulate GCC's defines. Suffice to say, we've done it before to provide clang diagnostics but build with GCC.
- plorkyeran 13y ago"stuck with GCC" is rather unfair. GCC still produces faster binaries on x86_64 Linux, which is very important for Facebook.
- DannyBee 13y agoYes, and no offense, but while other large companies have folks working on fixing this in public, i don't see facebook trying. This is really not meant as a dig (really!), but more of "why i figured facebook was not trying to make a transition". The companies trying to do so, are contributing heavily to LLVM to make that transition :)
- tr43esa323 13y agoDude, shut up already. Why would they try on fixing that ? GCC works better
- the_mitsuhiko 13y agoDevelop on clang, do automated tests and release builds on GCC?
- bames53 13y agoYou can undefine predefined macros in clang using -U. I took a little time to write some commands that should produce something close to the right defines/undefines to let one compiler's preprocessor masquerade as another compiler's preprocessor: http://coliru.stacked-crooked.com/a/17122f90ec070d55 http://coliru.stacked-crooked.com/a/17122f90ec070d55