Skip to content

Commit b0e9797

Browse files
committed
[PassInstrumentation] Remove excess newline for the new pass manager
This also removes excess newline for the legacy pass manager when -filter-print-funcs is specified.
1 parent 5190cf8 commit b0e9797

File tree

4 files changed

+16
-25
lines changed

4 files changed

+16
-25
lines changed

llvm/lib/IR/AsmWriter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3400,9 +3400,6 @@ void AssemblyWriter::printTypeIdentities() {
34003400

34013401
/// printFunction - Print all aspects of a function.
34023402
void AssemblyWriter::printFunction(const Function *F) {
3403-
// Print out the return type and name.
3404-
Out << '\n';
3405-
34063403
if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out);
34073404

34083405
if (F->isMaterializable())

llvm/lib/IR/IRPrintingPasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ PreservedAnalyses PrintFunctionPass::run(Function &F,
5757
if (forcePrintModuleIR())
5858
OS << Banner << " (function: " << F.getName() << ")\n" << *F.getParent();
5959
else
60-
OS << Banner << static_cast<Value &>(F);
60+
OS << Banner << '\n' << static_cast<Value &>(F);
6161
}
6262
return PreservedAnalyses::all();
6363
}

llvm/test/Other/2010-05-06-Printer.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ define void @foo(){
1616
;ALL: ModuleID =
1717

1818
;FOO: IR Dump After
19-
;FOO-EMPTY:
2019
;FOO-NEXT: define void @foo()
2120
;FOO-NOT: define void @tester

llvm/test/Other/printer.ll

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
; RUN: opt -mem2reg -instcombine -print-after-all -disable-output < %s 2>&1 | FileCheck %s
2-
; RUN: opt -passes='mem2reg,instcombine' -print-after-all -disable-output < %s 2>&1 | FileCheck %s
1+
; RUN: opt -mem2reg -instcombine -print-after-all -disable-output < %s 2>&1 | \
2+
; RUN: FileCheck --check-prefixes=CHECK,OLDPM %s --implicit-check-not='IR Dump'
3+
; RUN: opt -passes='mem2reg,instcombine' -print-after-all -disable-output < %s 2>&1 | \
4+
; RUN: FileCheck --check-prefixes=CHECK,NEWPM %s --implicit-check-not='IR Dump'
35
define void @tester(){
46
ret void
57
}
@@ -8,21 +10,14 @@ define void @foo(){
810
ret void
911
}
1012

11-
;CHECK-NOT: IR Dump After PassManager
12-
;CHECK-NOT: IR Dump After ModuleToFunctionPassAdaptor
13-
;
14-
;CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
15-
;CHECK: define void @tester
16-
;CHECK-NOT: define void @foo
17-
;CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
18-
;CHECK: define void @tester
19-
;CHECK-NOT: define void @foo
20-
;CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
21-
;CHECK: define void @foo
22-
;CHECK-NOT: define void @tester
23-
;CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
24-
;CHECK: define void @foo
25-
;CHECK-NOT: define void @tester
26-
;CHECK: *** IR Dump After {{Module Verifier|VerifierPass}}
27-
;
28-
;CHECK-NOT: IR Dump After Print Module IR
13+
; NEWPM: *** IR Dump After VerifierPass
14+
; CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
15+
; CHECK-NEXT: define void @tester
16+
; CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
17+
; CHECK-NEXT: define void @tester
18+
; OLDPM: *** IR Dump After Module Verifier
19+
; CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
20+
; CHECK-NEXT: define void @foo
21+
; CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
22+
; CHECK-NEXT: define void @foo
23+
; CHECK: *** IR Dump After {{Module Verifier|VerifierPass}}

0 commit comments

Comments
 (0)