[Frontend] -MP: remove blank lines

GCC 10 removed blank lines for phony targets during a refactoring.
The blank lines seems unuseful, so let's follow suit.
This commit is contained in:
Fangrui Song 2022-10-28 20:46:27 -07:00
parent ff9576f745
commit 0cc9710a0d
2 changed files with 3 additions and 8 deletions

View File

@ -326,7 +326,7 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) {
void DependencyFileGenerator::outputDependencyFile(llvm::raw_ostream &OS) {
// Write out the dependency targets, trying to avoid overly long
// lines when possible. We try our best to emit exactly the same
// dependency file as GCC (4.2), assuming the included files are the
// dependency file as GCC>=10, assuming the included files are the
// same.
const unsigned MaxColumns = 75;
unsigned Columns = 0;
@ -375,7 +375,6 @@ void DependencyFileGenerator::outputDependencyFile(llvm::raw_ostream &OS) {
for (auto I = Files.begin(), E = Files.end(); I != E; ++I) {
if (Index++ == InputFileIndex)
continue;
OS << '\n';
PrintFilename(OS, *I, OutputFormat);
OS << ":\n";
}

View File

@ -6,17 +6,13 @@
/// Verify that phony targets are only created for the extra dependency files,
/// and not the input file.
// CHECK:dependency-gen-phony.o: 1.extra 2.extra dependency-gen-phony.c \
// CHECK-NEXT: Inputs{{/|\\\\}}empty.h
// CHECK-EMPTY:
// CHECK-NEXT: Inputs{{/|\\}}empty.h
// CHECK-NEXT:1.extra:
// CHECK-EMPTY:
// CHECK-NEXT:2.extra:
// CHECK-EMPTY:
// CHECK-NEXT:{{.*}}empty.h:
// CHECK-NOT:{{.}}
// STDIO: -.o: Inputs{{/|\\\\}}empty.h
// STDIO-EMPTY:
// STDIO: -.o: Inputs{{/|\\}}empty.h
// STDIO-NEXT: {{.*}}empty.h:
// STDIO-NOT: {{.}}