[cfe-commits] r52788 - /cfe/trunk/lib/Lex/Preprocessor.cpp
    Chris Lattner 
    sabre at nondot.org
       
    Thu Jun 26 10:26:01 PDT 2008
    
    
  
Author: lattner
Date: Thu Jun 26 12:26:01 2008
New Revision: 52788
URL: http://llvm.org/viewvc/llvm-project?rev=52788&view=rev
Log:
clang uses the llvm backend, so define __llvm__ like llvm-gcc.  
Additionally, define __clang__ so clients can predicate based on
clang features.
Modified:
    cfe/trunk/lib/Lex/Preprocessor.cpp
Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=52788&r1=52787&r2=52788&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Thu Jun 26 12:26:01 2008
@@ -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");
    
    
More information about the cfe-commits
mailing list