r179862 - Keep the parentheses in #pragma message (partial revert of r179771).
Andy Gibbs
andyg1001 at hotmail.co.uk
Fri Apr 19 10:13:17 PDT 2013
Author: andyg
Date: Fri Apr 19 12:13:17 2013
New Revision: 179862
URL: http://llvm.org/viewvc/llvm-project?rev=179862&view=rev
Log:
Keep the parentheses in #pragma message (partial revert of r179771).
Modified:
cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
cfe/trunk/test/Lexer/pragma-message2.c
cfe/trunk/test/Lexer/pragma-operators.cpp
Modified: cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp?rev=179862&r1=179861&r2=179862&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp (original)
+++ cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp Fri Apr 19 12:13:17 2013
@@ -419,7 +419,7 @@ void PrintPPOutputPPCallbacks::PragmaMes
OS << Namespace << ' ';
switch (Kind) {
case PMK_Message:
- OS << "message \"";
+ OS << "message(\"";
break;
case PMK_Warning:
OS << "warning \"";
@@ -440,6 +440,8 @@ void PrintPPOutputPPCallbacks::PragmaMes
<< (char)('0'+ ((Char >> 0) & 7));
}
OS << '"';
+ if (Kind == PMK_Message)
+ OS << ')';
setEmittedDirectiveOnThisLine();
}
Modified: cfe/trunk/test/Lexer/pragma-message2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/pragma-message2.c?rev=179862&r1=179861&r2=179862&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/pragma-message2.c (original)
+++ cfe/trunk/test/Lexer/pragma-message2.c Fri Apr 19 12:13:17 2013
@@ -1,10 +1,10 @@
// RUN: %clang_cc1 -E -Werror -verify %s 2>&1 | FileCheck %s
#pragma message "\\test" // expected-warning {{\test}}
-// CHECK: #pragma message "\134test"
+// CHECK: #pragma message("\134test")
#pragma message("\\test") // expected-warning {{\test}}
-// CHECK: #pragma message "\134test"
+// CHECK: #pragma message("\134test")
#pragma GCC warning "\"" "te" "st" "\"" // expected-warning {{"test"}}
// CHECK: #pragma GCC warning "\042test\042"
Modified: cfe/trunk/test/Lexer/pragma-operators.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/pragma-operators.cpp?rev=179862&r1=179861&r2=179862&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/pragma-operators.cpp (original)
+++ cfe/trunk/test/Lexer/pragma-operators.cpp Fri Apr 19 12:13:17 2013
@@ -32,6 +32,6 @@ B(foo)
// CHECK: #pragma comment(lib, "libfoo")
// CHECK: #pragma clang diagnostic ignored "-Wunused"
// CHECK: #pragma clang diagnostic error "-Wunused"
-// CHECK: #pragma message "\042Hello\042, world!"
+// CHECK: #pragma message("\042Hello\042, world!")
// CHECK: 0;
int n = pragma_L pragma_u8 pragma_u pragma_U pragma_R pragma_UR pragma_hello 0;
More information about the cfe-commits
mailing list