aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/IRPrintingPasses.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/IRPrintingPasses.cpp')
-rw-r--r--lib/IR/IRPrintingPasses.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/IR/IRPrintingPasses.cpp b/lib/IR/IRPrintingPasses.cpp
index 3b32814bed5c..befe1d9ffb1c 100644
--- a/lib/IR/IRPrintingPasses.cpp
+++ b/lib/IR/IRPrintingPasses.cpp
@@ -127,13 +127,13 @@ public:
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,
@@ -150,3 +150,11 @@ BasicBlockPass *llvm::createPrintBasicBlockPass(llvm::raw_ostream &OS,
const std::string &Banner) {
return new PrintBasicBlockPass(OS, Banner);
}
+
+bool llvm::isIRPrintingPass(Pass *P) {
+ const char *PID = (const char*)P->getPassID();
+
+ return (PID == &PrintModulePassWrapper::ID)
+ || (PID == &PrintFunctionPassWrapper::ID)
+ || (PID == &PrintBasicBlockPass::ID);
+}