diff options
| author | David Greene <greened@obbligato.org> | 2010-04-02 23:17:14 +0000 |
|---|---|---|
| committer | David Greene <greened@obbligato.org> | 2010-04-02 23:17:14 +0000 |
| commit | 68a217169a546c904bb1dc8ac3f1afb36a29020c (patch) | |
| tree | 71f9b6e935bfe9fda09ef15a2d3de3bd4f6e3d46 /include/llvm/CodeGen | |
| parent | 3c8e201e1bc262d254a7cce67eed3204052f0d79 (diff) | |
| download | external_llvm-68a217169a546c904bb1dc8ac3f1afb36a29020c.zip external_llvm-68a217169a546c904bb1dc8ac3f1afb36a29020c.tar.gz external_llvm-68a217169a546c904bb1dc8ac3f1afb36a29020c.tar.bz2 | |
Ok, third time's the charm. No changes from last time except the CMake
source addition. Apparently the buildbots were wrong about failures.
---
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@100249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
| -rw-r--r-- | include/llvm/CodeGen/MachineFunctionPass.h | 3 | ||||
| -rw-r--r-- | include/llvm/CodeGen/Passes.h | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineFunctionPass.h b/include/llvm/CodeGen/MachineFunctionPass.h index bac1103..1a2b129 100644 --- a/include/llvm/CodeGen/MachineFunctionPass.h +++ b/include/llvm/CodeGen/MachineFunctionPass.h @@ -34,6 +34,9 @@ protected: explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} + /// createPrinterPass - Get a machine function printer pass. + Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; + /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. /// diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h index 911be22..d3c2720 100644 --- a/include/llvm/CodeGen/Passes.h +++ b/include/llvm/CodeGen/Passes.h @@ -21,6 +21,7 @@ namespace llvm { class FunctionPass; + class MachineFunctionPass; class PassInfo; class TargetLowering; class RegisterCoalescer; @@ -36,8 +37,9 @@ namespace llvm { /// MachineFunctionPrinter pass - This pass prints out the machine function to /// the given stream, as a debugging tool. - FunctionPass *createMachineFunctionPrinterPass(raw_ostream &OS, - const std::string &Banner =""); + MachineFunctionPass * + createMachineFunctionPrinterPass(raw_ostream &OS, + const std::string &Banner =""); /// MachineLoopInfo pass - This pass is a loop analysis pass. /// |
