[PATCH] D48723: Fix IRPrinting bug

Son Tuan Vu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 07:46:16 PDT 2018


tyb0807 created this revision.
tyb0807 added reviewers: dexonsmith, chandlerc.
Herald added a subscriber: llvm-commits.

Hello all,

Currently, all IRPrinting passes are not considered as analysis, so when `-print-after/before-all` option enabled, we'll print the IR twice in a row. For example, with:

  $ opt -O1 -print-after-all -debug-pass=Arguments -S -o /dev/null

we got

  Pass Arguments:  -targetlibinfo ... -print-module -print-module

This patch will remove the second `-print-module` pass from the pipeline.


Repository:
  rL LLVM

https://reviews.llvm.org/D48723

Files:
  lib/IR/IRPrintingPasses.cpp


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.153320.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180628/1c9e477e/attachment-0001.bin>


More information about the llvm-commits mailing list