OSDN Git Service

Add some switches helpful for debugging:
authorDavid Greene <greened@obbligato.org>
Thu, 1 Apr 2010 22:43:57 +0000 (22:43 +0000)
committerDavid Greene <greened@obbligato.org>
Thu, 1 Apr 2010 22:43:57 +0000 (22:43 +0000)
commit86a7e009b9c72cfdeb186ab7f138b855950a9f29
treeeb24eedb1c0e990efe72699d85bdd7ddd7f28e73
parent281d37e6f577acd98b3b6fb1ac7a2b65b8ebf8b4
Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100143 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/llvm/Analysis/LoopPass.h
include/llvm/Assembly/PrintModulePass.h
include/llvm/CallGraphSCCPass.h
include/llvm/CodeGen/MachineFunctionPass.h
include/llvm/CodeGen/Passes.h
include/llvm/Pass.h
lib/Analysis/IPA/CallGraphSCCPass.cpp
lib/Analysis/LoopPass.cpp
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/MachineFunctionPass.cpp
lib/CodeGen/MachineFunctionPrinterPass.cpp [new file with mode: 0644]
lib/VMCore/Pass.cpp
lib/VMCore/PassManager.cpp
lib/VMCore/PrintModulePass.cpp