aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorPedro Artigas <partigas@apple.com>2012-12-03 21:56:57 +0000
committerPedro Artigas <partigas@apple.com>2012-12-03 21:56:57 +0000
commit49eb628c21b358380b76df82aa3dfe0baab4c6ec (patch)
tree29d69b3d5f7545a0dc7def41118e59b1dd28036b /lib/VMCore
parentf7e78487de159940e00e3fadaf6b2e023e2ad8fe (diff)
downloadexternal_llvm-49eb628c21b358380b76df82aa3dfe0baab4c6ec.zip
external_llvm-49eb628c21b358380b76df82aa3dfe0baab4c6ec.tar.gz
external_llvm-49eb628c21b358380b76df82aa3dfe0baab4c6ec.tar.bz2
moves doInitialization and doFinalization to the Pass class and removes some unreachable code in MachineModuleInfo
reviewed by Evan Cheng <evan.cheng@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Pass.cpp20
-rw-r--r--lib/VMCore/PassManager.cpp6
2 files changed, 6 insertions, 20 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index 9d0ed48..ec448e6 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -133,16 +133,6 @@ Pass *FunctionPass::createPrinterPass(raw_ostream &O,
return createPrintFunctionPass(Banner, &O);
}
-bool FunctionPass::doInitialization(Module &) {
- // By default, don't do anything.
- return false;
-}
-
-bool FunctionPass::doFinalization(Module &) {
- // By default, don't do anything.
- return false;
-}
-
PassManagerType FunctionPass::getPotentialPassManagerType() const {
return PMT_FunctionPassManager;
}
@@ -157,11 +147,6 @@ Pass *BasicBlockPass::createPrinterPass(raw_ostream &O,
llvm_unreachable("BasicBlockPass printing unsupported.");
}
-bool BasicBlockPass::doInitialization(Module &) {
- // By default, don't do anything.
- return false;
-}
-
bool BasicBlockPass::doInitialization(Function &) {
// By default, don't do anything.
return false;
@@ -172,11 +157,6 @@ bool BasicBlockPass::doFinalization(Function &) {
return false;
}
-bool BasicBlockPass::doFinalization(Module &) {
- // By default, don't do anything.
- return false;
-}
-
PassManagerType BasicBlockPass::getPotentialPassManagerType() const {
return PMT_BasicBlockPassManager;
}
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index 069bd35..875ab5c 100644
--- a/lib/VMCore/PassManager.cpp
+++ b/lib/VMCore/PassManager.cpp
@@ -309,6 +309,9 @@ public:
/// whether any of the passes modifies the module, and if so, return true.
bool runOnModule(Module &M);
+ using llvm::Pass::doInitialization;
+ using llvm::Pass::doFinalization;
+
/// doInitialization - Run all of the initializers for the module passes.
///
bool doInitialization();
@@ -402,6 +405,9 @@ public:
/// whether any of the passes modifies the module, and if so, return true.
bool run(Module &M);
+ using llvm::Pass::doInitialization;
+ using llvm::Pass::doFinalization;
+
/// doInitialization - Run all of the initializers for the module passes.
///
bool doInitialization();