From d86522a2c7722b85cac070178b6590093dd9d827 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 26 Jun 2008 17:26:01 +0000 Subject: [PATCH] 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 --- lib/Lex/Preprocessor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 8dac3f066f..32ee8f0c81 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/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"); -- 2.50.1