accept "#pragma clang foo" where we accept "#pragma GCC foo".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71572 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index bde3fbc..ce59341 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -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(
diff --git a/test/Lexer/constants.c b/test/Lexer/constants.c
index c035531..fcb6de9 100644
--- a/test/Lexer/constants.c
+++ b/test/Lexer/constants.c
@@ -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.