summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-26 17:26:01 +0000
committerChris Lattner <sabre@nondot.org>2008-06-26 17:26:01 +0000
commitd1224b249391162a7c9673099fd68b3e1b640cdb (patch)
tree598869fe79898194ce184ee535f266b21563506d /clang/lib/Lex/Preprocessor.cpp
parent1aab7a5b2a49bf46769711c7725c51890472852d (diff)
downloadbcm5719-llvm-d1224b249391162a7c9673099fd68b3e1b640cdb.tar.gz
bcm5719-llvm-d1224b249391162a7c9673099fd68b3e1b640cdb.zip
clang uses the llvm backend, so define __llvm__ like llvm-gcc.
Additionally, define __clang__ so clients can predicate based on clang features. llvm-svn: 52788
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 8dac3f066fa..32ee8f0c817 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -414,6 +414,9 @@ static void InitializePredefinedMacros(Preprocessor &PP,
// 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");
OpenPOWER on IntegriCloud