summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-11-28 16:42:27 -0800
committerFangrui Song <maskray@google.com>2019-11-28 17:20:17 -0800
commitb0e979724f2679e4e6f5b824144ea89289bd6d56 (patch)
treea5d24ad8c481cd784a3d0ebc47e82904d7a6663d
parent5190cf8ffd9a7878d79fd92a5e682891f0693377 (diff)
downloadbcm5719-llvm-b0e979724f2679e4e6f5b824144ea89289bd6d56.tar.gz
bcm5719-llvm-b0e979724f2679e4e6f5b824144ea89289bd6d56.zip
[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.
-rw-r--r--llvm/lib/IR/AsmWriter.cpp3
-rw-r--r--llvm/lib/IR/IRPrintingPasses.cpp2
-rw-r--r--llvm/test/Other/2010-05-06-Printer.ll1
-rw-r--r--llvm/test/Other/printer.ll35
4 files changed, 16 insertions, 25 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 01989b97f7f..f9d4b181f86 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -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())
diff --git a/llvm/lib/IR/IRPrintingPasses.cpp b/llvm/lib/IR/IRPrintingPasses.cpp
index 8fa97a3aecb..03657ff8d9d 100644
--- a/llvm/lib/IR/IRPrintingPasses.cpp
+++ b/llvm/lib/IR/IRPrintingPasses.cpp
@@ -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();
}
diff --git a/llvm/test/Other/2010-05-06-Printer.ll b/llvm/test/Other/2010-05-06-Printer.ll
index 9e7c9cb6ab4..decd977c3d2 100644
--- a/llvm/test/Other/2010-05-06-Printer.ll
+++ b/llvm/test/Other/2010-05-06-Printer.ll
@@ -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
diff --git a/llvm/test/Other/printer.ll b/llvm/test/Other/printer.ll
index 9785a17b228..86337656285 100644
--- a/llvm/test/Other/printer.ll
+++ b/llvm/test/Other/printer.ll
@@ -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}}
OpenPOWER on IntegriCloud