From: Richard Smith Date: Fri, 8 Apr 2016 01:23:59 +0000 (+0000) Subject: [modules] Add a comment to explain why -E leaves some #includes in the preprocessed... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7249d7283da9cb6ba8ace1fe4cb8e626e1b76dfd;p=clang [modules] Add a comment to explain why -E leaves some #includes in the preprocessed output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265766 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp index 9524b58e3a..77b80e612f 100644 --- a/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/lib/Frontend/PrintPreprocessedOutput.cpp @@ -336,7 +336,9 @@ void PrintPPOutputPPCallbacks::InclusionDirective(SourceLocation HashLoc, OS << "#include " << (IsAngled ? '<' : '"') << FileName - << (IsAngled ? '>' : '"'); + << (IsAngled ? '>' : '"') + << " /* clang -E: implicit import for module " + << Imported->getFullModuleName() << " */"; } // Since we want a newline after the @import, but not a #, start a new // line immediately. diff --git a/test/Modules/preprocess.cpp b/test/Modules/preprocess.cpp index aa28191722..0615331c8b 100644 --- a/test/Modules/preprocess.cpp +++ b/test/Modules/preprocess.cpp @@ -1,6 +1,6 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x c++ -E %s | \ -// RUN: FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=CXX +// RUN: FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=CXX --check-prefix=CXX-DASHE // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x objective-c -E %s | \ // RUN: FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=OBJC // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x c++ -E -frewrite-includes %s | \ @@ -14,7 +14,9 @@ foo bar baz // The weird {{ }} here is to prevent the -frewrite-includes test from matching its own CHECK lines. // CXX: #include{{ }}"dummy.h" +// CXX-DASHE-SAME: /* clang -E: implicit import for module dummy */ // CXX: #include{{ }}"dummy.h" +// CXX-DASHE-SAME: /* clang -E: implicit import for module dummy */ // CXX: foo bar baz // OBJC: @import{{ }}dummy; /* clang