[llvm-branch-commits] [cfe-branch] r71621 - in /cfe/branches/Apple/Dib: lib/Lex/Pragma.cpp test/Lexer/constants.c

Mike Stump mrs at apple.com
Tue May 12 20:04:00 PDT 2009


Author: mrs
Date: Tue May 12 22:03:55 2009
New Revision: 71621

URL: http://llvm.org/viewvc/llvm-project?rev=71621&view=rev
Log:
Merge in 71572:

accept "#pragma clang foo" where we accept "#pragma GCC foo".

Modified:
    cfe/branches/Apple/Dib/lib/Lex/Pragma.cpp
    cfe/branches/Apple/Dib/test/Lexer/constants.c

Modified: cfe/branches/Apple/Dib/lib/Lex/Pragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/Lex/Pragma.cpp?rev=71621&r1=71620&r2=71621&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/Lex/Pragma.cpp (original)
+++ cfe/branches/Apple/Dib/lib/Lex/Pragma.cpp Tue May 12 22:03:55 2009
@@ -666,6 +666,8 @@
 void Preprocessor::RegisterBuiltinPragmas() {
   AddPragmaHandler(0, new PragmaOnceHandler(getIdentifierInfo("once")));
   AddPragmaHandler(0, new PragmaMarkHandler(getIdentifierInfo("mark")));
+  
+  // #pragma GCC ...
   AddPragmaHandler("GCC", new PragmaPoisonHandler(getIdentifierInfo("poison")));
   AddPragmaHandler("GCC", new PragmaSystemHeaderHandler(
                                           getIdentifierInfo("system_header")));
@@ -673,7 +675,16 @@
                                           getIdentifierInfo("dependency")));
   AddPragmaHandler("GCC", new PragmaDiagnosticHandler(
                                               getIdentifierInfo("diagnostic")));
-  
+  // #pragma clang ...
+  AddPragmaHandler("clang", new PragmaPoisonHandler(
+                                          getIdentifierInfo("poison")));
+  AddPragmaHandler("clang", new PragmaSystemHeaderHandler(
+                                          getIdentifierInfo("system_header")));
+  AddPragmaHandler("clang", new PragmaDependencyHandler(
+                                          getIdentifierInfo("dependency")));
+  AddPragmaHandler("clang", new PragmaDiagnosticHandler(
+                                          getIdentifierInfo("diagnostic")));
+
   AddPragmaHandler("STDC", new PragmaSTDC_FP_CONTRACTHandler(
                                              getIdentifierInfo("FP_CONTRACT")));
   AddPragmaHandler("STDC", new PragmaSTDC_FENV_ACCESSHandler(

Modified: cfe/branches/Apple/Dib/test/Lexer/constants.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/Lexer/constants.c?rev=71621&r1=71620&r2=71621&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/test/Lexer/constants.c (original)
+++ cfe/branches/Apple/Dib/test/Lexer/constants.c Tue May 12 22:03:55 2009
@@ -25,11 +25,11 @@
 };
 
 
-#pragma GCC diagnostic ignored "-Wmultichar"
+#pragma clang diagnostic ignored "-Wmultichar"
 
 char d = 'df'; // no warning.
 char e = 'abcd';  // still warn: expected-warning {{multi-character character constant}}
 
-#pragma GCC diagnostic ignored "-Wfour-char-constants"
+#pragma clang diagnostic ignored "-Wfour-char-constants"
 
 char f = 'abcd';  // ignored.





More information about the llvm-branch-commits mailing list