[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.
This commit is contained in:
Fangrui Song 2019-11-28 16:42:27 -08:00
parent 0809ea774a
commit 5c162bc608
4 changed files with 16 additions and 25 deletions

View File

@ -3400,9 +3400,6 @@ void AssemblyWriter::printTypeIdentities() {
/// printFunction - Print all aspects of a function.
void AssemblyWriter::printFunction(const Function *F) {
// Print out the return type and name.
Out << '\n';
if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out);
if (F->isMaterializable())

View File

@ -57,7 +57,7 @@ PreservedAnalyses PrintFunctionPass::run(Function &F,
if (forcePrintModuleIR())
OS << Banner << " (function: " << F.getName() << ")\n" << *F.getParent();
else
OS << Banner << static_cast<Value &>(F);
OS << Banner << '\n' << static_cast<Value &>(F);
}
return PreservedAnalyses::all();
}

View File

@ -16,6 +16,5 @@ define void @foo(){
;ALL: ModuleID =
;FOO: IR Dump After
;FOO-EMPTY:
;FOO-NEXT: define void @foo()
;FOO-NOT: define void @tester

View File

@ -1,5 +1,7 @@
; RUN: opt -mem2reg -instcombine -print-after-all -disable-output < %s 2>&1 | FileCheck %s
; RUN: opt -passes='mem2reg,instcombine' -print-after-all -disable-output < %s 2>&1 | FileCheck %s
; RUN: opt -mem2reg -instcombine -print-after-all -disable-output < %s 2>&1 | \
; RUN: FileCheck --check-prefixes=CHECK,OLDPM %s --implicit-check-not='IR Dump'
; RUN: opt -passes='mem2reg,instcombine' -print-after-all -disable-output < %s 2>&1 | \
; RUN: FileCheck --check-prefixes=CHECK,NEWPM %s --implicit-check-not='IR Dump'
define void @tester(){
ret void
}
@ -8,21 +10,14 @@ define void @foo(){
ret void
}
;CHECK-NOT: IR Dump After PassManager
;CHECK-NOT: IR Dump After ModuleToFunctionPassAdaptor
;
;CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
;CHECK: define void @tester
;CHECK-NOT: define void @foo
;CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
;CHECK: define void @tester
;CHECK-NOT: define void @foo
;CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
;CHECK: define void @foo
;CHECK-NOT: define void @tester
;CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
;CHECK: define void @foo
;CHECK-NOT: define void @tester
;CHECK: *** IR Dump After {{Module Verifier|VerifierPass}}
;
;CHECK-NOT: IR Dump After Print Module IR
; NEWPM: *** IR Dump After VerifierPass
; CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
; CHECK-NEXT: define void @tester
; CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
; CHECK-NEXT: define void @tester
; OLDPM: *** IR Dump After Module Verifier
; CHECK: *** IR Dump After {{Promote Memory to Register|PromotePass}}
; CHECK-NEXT: define void @foo
; CHECK: *** IR Dump After {{Combine redundant instructions|InstCombinePass}}
; CHECK-NEXT: define void @foo
; CHECK: *** IR Dump After {{Module Verifier|VerifierPass}}