]> granicus.if.org Git - clang/commitdiff
accept "#pragma clang foo" where we accept "#pragma GCC foo".
authorChris Lattner <sabre@nondot.org>
Tue, 12 May 2009 18:21:11 +0000 (18:21 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 12 May 2009 18:21:11 +0000 (18:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71572 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Pragma.cpp
test/Lexer/constants.c

index bde3fbc0e87080856ffe211086cadff5e9f2f401..ce5934134f426c3940b09b6e6da4995554c5078c 100644 (file)
@@ -666,6 +666,8 @@ struct PragmaSTDC_UnknownHandler : public PragmaHandler {
 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 @@ void Preprocessor::RegisterBuiltinPragmas() {
                                           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(
index c0355314b2640126fc325d55abe588a6055e39e5..fcb6de954516bcb925467d972c311f4e17144cae 100644 (file)
@@ -25,11 +25,11 @@ t',
 };
 
 
-#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.