From d1224b249391162a7c9673099fd68b3e1b640cdb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 26 Jun 2008 17:26:01 +0000 Subject: 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 --- clang/lib/Lex/Preprocessor.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Lex/Preprocessor.cpp') 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"); -- cgit v1.2.3