summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-05-30 00:17:12 +0000
committerBob Wilson <bob.wilson@apple.com>2012-05-30 00:17:12 +0000
commit33e5188c270fbd5ccce4ea4656f75c95ec68cfaf (patch)
treeeebfb851efa47d7d5f7ecd7054a2fba96afdf999 /llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp
parent45601d1742d159c261f7b255e00e72e55805b792 (diff)
downloadbcm5719-llvm-33e5188c270fbd5ccce4ea4656f75c95ec68cfaf.tar.gz
bcm5719-llvm-33e5188c270fbd5ccce4ea4656f75c95ec68cfaf.zip
Add an insertPass API to TargetPassConfig. <rdar://problem/11498613>
Besides adding the new insertPass function, this patch uses it to enhance the existing -print-machineinstrs so that the MachineInstrs after a specific pass can be printed. Patch by Bin Zeng! llvm-svn: 157655
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp b/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp
index 2aaa798a02c..dbda93e4fd9 100644
--- a/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp
+++ b/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp
@@ -15,6 +15,7 @@
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Debug.h"
using namespace llvm;
@@ -28,6 +29,7 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass {
raw_ostream &OS;
const std::string Banner;
+ MachineFunctionPrinterPass() : MachineFunctionPass(ID), OS(dbgs()) { }
MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner)
: MachineFunctionPass(ID), OS(os), Banner(banner) {}
@@ -48,6 +50,10 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass {
char MachineFunctionPrinterPass::ID = 0;
}
+char &MachineFunctionPrinterPassID = MachineFunctionPrinterPass::ID;
+INITIALIZE_PASS(MachineFunctionPrinterPass, "print-machineinstrs",
+ "Machine Function Printer", false, false)
+
namespace llvm {
/// Returns a newly-created MachineFunction Printer pass. The
/// default banner is empty.
OpenPOWER on IntegriCloud