clang uses the llvm backend, so define __llvm__ like llvm-gcc.
Additionally, define __clang__ so clients can predicate based on
clang features.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52788 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 8dac3f0..32ee8f0 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -414,6 +414,9 @@
// Get the target #defines.
PP.getTargetInfo().getTargetDefines(Buf);
+
+ DefineBuiltinMacro(Buf, "__llvm__=1"); // LLVM Backend
+ DefineBuiltinMacro(Buf, "__clang__=1"); // Clang Frontend
// Compiler set macros.
DefineBuiltinMacro(Buf, "__APPLE_CC__=5250");