[llvm-branch-commits] [cfe-branch] r71668 - in /cfe/branches/Apple/Dib: lib/Lex/Lexer.cpp test/Preprocessor/_Pragma.c

Mike Stump mrs at apple.com
Wed May 13 08:34:58 PDT 2009


Author: mrs
Date: Wed May 13 10:34:47 2009
New Revision: 71668

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

Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.

Modified:
    cfe/branches/Apple/Dib/lib/Lex/Lexer.cpp
    cfe/branches/Apple/Dib/test/Preprocessor/_Pragma.c

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

==============================================================================
--- cfe/branches/Apple/Dib/lib/Lex/Lexer.cpp (original)
+++ cfe/branches/Apple/Dib/lib/Lex/Lexer.cpp Wed May 13 10:34:47 2009
@@ -1631,7 +1631,7 @@
         // it's actually the start of a preprocessing directive.  Callback to
         // the preprocessor to handle it.
         // FIXME: -fpreprocessed mode??
-        if (Result.isAtStartOfLine() && !LexingRawMode) {
+        if (Result.isAtStartOfLine() && !LexingRawMode && !Is_PragmaLexer) {
           FormTokenWithChars(Result, CurPtr, tok::hash);
           PP->HandleDirective(Result);
           
@@ -1762,7 +1762,7 @@
       // it's actually the start of a preprocessing directive.  Callback to
       // the preprocessor to handle it.
       // FIXME: -fpreprocessed mode??
-      if (Result.isAtStartOfLine() && !LexingRawMode) {
+      if (Result.isAtStartOfLine() && !LexingRawMode && !Is_PragmaLexer) {
         FormTokenWithChars(Result, CurPtr, tok::hash);
         PP->HandleDirective(Result);
         

Modified: cfe/branches/Apple/Dib/test/Preprocessor/_Pragma.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/Preprocessor/_Pragma.c?rev=71668&r1=71667&r2=71668&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/test/Preprocessor/_Pragma.c (original)
+++ cfe/branches/Apple/Dib/test/Preprocessor/_Pragma.c Wed May 13 10:34:47 2009
@@ -1,4 +1,10 @@
-// RUN: clang-cc %s -E -verify
+// RUN: clang-cc %s -verify -Wall
 
 _Pragma ("GCC system_header")  // expected-warning {{system_header ignored in main file}}
 
+// rdar://6880630
+_Pragma("#define macro")    // expected-warning {{unknown pragma ignored}}
+
+#ifdef macro
+#error #define invalid
+#endif





More information about the llvm-branch-commits mailing list