OSDN Git Service

IR printing improvement for function passes - introducing -print-module-scope
authorFedor Sergeev <fedor.sergeev@azul.com>
Fri, 1 Dec 2017 17:42:46 +0000 (17:42 +0000)
committerFedor Sergeev <fedor.sergeev@azul.com>
Fri, 1 Dec 2017 17:42:46 +0000 (17:42 +0000)
commit7d160f714357f6784ead669ce516e94991c12e5a
treee569a91159b78f4b76e27844dc3e5840fbbc32af
parent31eff6b5eec89f1e512845d8eaf676e763851fb9
IR printing improvement for function passes - introducing -print-module-scope

Summary:
When debugging function passes it happens to be rather useful to dump
the whole module before the transformation and then use this dump
to analyze this single transformation by running it separately
on that particular module state.

Introducing
    -print-module-scope
debugging option that forces all the function-level IR dumps
to become whole-module dumps.

This option builds on top of normal dumping controls like
   -print-before/after
   -filter-print-funcs

The plan is to eventually extend this option to cover other local passes
(at least loop passes) but that should go as a separate change.

Reviewers: sanjoy, weimingz, silvas, fedor.sergeev

Reviewed By: weimingz

Subscribers: apilipenko, skatkov, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D40245

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319561 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Pass.h
lib/IR/IRPrintingPasses.cpp
lib/IR/LegacyPassManager.cpp
test/Other/print-module-scope.ll [new file with mode: 0644]