[PATCH] D48723: Fix IRPrinting bug

Son Tuan Vu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 29 07:37:01 PDT 2018


tyb0807 updated this revision to Diff 153494.
tyb0807 added a comment.

No don't get me wrong, this patch is supposed to fix the issue in the `LegacyPassManager`, and I do not intend to change anything about the new pass manager in this patch.

As to implementing `print-after-all` in the new pass manager, I do not know what should be the best way to do yet... Your idea seems to be a good solution.

Anyway, tests added for this patch.


https://reviews.llvm.org/D48723

Files:
  lib/IR/IRPrintingPasses.cpp
  test/Other/printer.ll


Index: test/Other/printer.ll
===================================================================
--- /dev/null
+++ test/Other/printer.ll
@@ -0,0 +1,10 @@
+; RUN: opt -O1 -print-after-all -S < %s 2>&1 | FileCheck %s
+define void @tester(){
+  ret void
+}
+
+define void @foo(){
+  ret void
+}
+
+;CHECK-NOT: IR Dump After Print Module IR
Index: lib/IR/IRPrintingPasses.cpp
===================================================================
--- lib/IR/IRPrintingPasses.cpp
+++ lib/IR/IRPrintingPasses.cpp
@@ -127,13 +127,13 @@
 
 char PrintModulePassWrapper::ID = 0;
 INITIALIZE_PASS(PrintModulePassWrapper, "print-module",
-                "Print module to stderr", false, false)
+                "Print module to stderr", false, true)
 char PrintFunctionPassWrapper::ID = 0;
 INITIALIZE_PASS(PrintFunctionPassWrapper, "print-function",
-                "Print function to stderr", false, false)
+                "Print function to stderr", false, true)
 char PrintBasicBlockPass::ID = 0;
 INITIALIZE_PASS(PrintBasicBlockPass, "print-bb", "Print BB to stderr", false,
-                false)
+                true)
 
 ModulePass *llvm::createPrintModulePass(llvm::raw_ostream &OS,
                                         const std::string &Banner,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48723.153494.patch
Type: text/x-patch
Size: 1249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180629/939478d5/attachment.bin>


More information about the llvm-commits mailing list