hans created this revision.
hans added reviewers: thakis, brad.king.
hans added a subscriber: cfe-commits.
MSVC prints a blank line there, and it turns out CMake (at least currently
released versions) expects it to be there.
http://reviews.llvm.org/D19881
Files:
lib/Frontend/HeaderIncludeGen.cpp
test/Frontend/print-header-includes.c
Index: test/Frontend/print-header-includes.c
===================================================================
--- test/Frontend/print-header-includes.c
+++ test/Frontend/print-header-includes.c
@@ -8,6 +8,7 @@
// RUN: %clang_cc1 -I%S -include Inputs/test3.h -E --show-includes -o
/dev/null %s | \
// RUN: FileCheck --strict-whitespace --check-prefix=MS %s
// MS-NOT: <command line>
+// MS: {{^$}}
// MS: Note: including file: {{[^ ]*test3.h}}
// MS: Note: including file: {{[^ ]*test.h}}
// MS: Note: including file: {{[^ ]*test2.h}}
Index: lib/Frontend/HeaderIncludeGen.cpp
===================================================================
--- lib/Frontend/HeaderIncludeGen.cpp
+++ lib/Frontend/HeaderIncludeGen.cpp
@@ -99,6 +99,13 @@
}
}
+ if (MSStyle) {
+ // MSVC writes a blank line at the start of the output from /showIncludes,
+ // and some tools, such as certain versions of CMake (see PR27226) expect
+ // it to be there.
+ *OutputFile << '\n';
+ }
+
// Print header info for extra headers, pretending they were discovered by
// the regular preprocessor. The primary use case is to support proper
// generation of Make / Ninja file dependencies for implicit includes, such
Index: test/Frontend/print-header-includes.c
===================================================================
--- test/Frontend/print-header-includes.c
+++ test/Frontend/print-header-includes.c
@@ -8,6 +8,7 @@
// RUN: %clang_cc1 -I%S -include Inputs/test3.h -E --show-includes -o /dev/null %s | \
// RUN: FileCheck --strict-whitespace --check-prefix=MS %s
// MS-NOT: <command line>
+// MS: {{^$}}
// MS: Note: including file: {{[^ ]*test3.h}}
// MS: Note: including file: {{[^ ]*test.h}}
// MS: Note: including file: {{[^ ]*test2.h}}
Index: lib/Frontend/HeaderIncludeGen.cpp
===================================================================
--- lib/Frontend/HeaderIncludeGen.cpp
+++ lib/Frontend/HeaderIncludeGen.cpp
@@ -99,6 +99,13 @@
}
}
+ if (MSStyle) {
+ // MSVC writes a blank line at the start of the output from /showIncludes,
+ // and some tools, such as certain versions of CMake (see PR27226) expect
+ // it to be there.
+ *OutputFile << '\n';
+ }
+
// Print header info for extra headers, pretending they were discovered by
// the regular preprocessor. The primary use case is to support proper
// generation of Make / Ninja file dependencies for implicit includes, such
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits