r180718 - When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line.

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Apr 29 10:26:23 PDT 2013


Author: akirtzidis
Date: Mon Apr 29 12:26:22 2013
New Revision: 180718

URL: http://llvm.org/viewvc/llvm-project?rev=180718&view=rev
Log:
When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line.

rdar://13722737

Modified:
    cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
    cfe/trunk/test/Preprocessor/pp-modules.c

Modified: cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp?rev=180718&r1=180717&r2=180718&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp (original)
+++ cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp Mon Apr 29 12:26:22 2013
@@ -335,6 +335,7 @@ void PrintPPOutputPPCallbacks::Inclusion
     MoveToLine(HashLoc);
     OS << "@import " << Imported->getFullModuleName() << ";"
        << " /* clang -E: implicit import for \"" << File->getName() << "\" */";
+    EmittedTokensOnThisLine = true;
   }
 }
 

Modified: cfe/trunk/test/Preprocessor/pp-modules.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/pp-modules.c?rev=180718&r1=180717&r2=180718&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/pp-modules.c (original)
+++ cfe/trunk/test/Preprocessor/pp-modules.c Mon Apr 29 12:26:22 2013
@@ -9,3 +9,7 @@ int bar();
 int foo();
 // CHECK: @import Module; /* clang -E: implicit import for "{{.*Headers[/\\]Module.h}}" */
 #include <Module/Module.h>
+
+#include "pp-modules.h" // CHECK: # 1 "{{.*}}pp-modules.h" 1
+// CHECK: @import Module; /* clang -E: implicit import for "{{.*}}Module.h" */{{$}}
+// CHECK: # 14 "{{.*}}pp-modules.c" 2





More information about the cfe-commits mailing list