summaryrefslogtreecommitdiff
path: root/include/llvm/Pass.h
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 /include/llvm/Pass.h
parentf7e78487de159940e00e3fadaf6b2e023e2ad8fe (diff)
downloadllvm-49eb628c21b358380b76df82aa3dfe0baab4c6ec.tar.gz
llvm-49eb628c21b358380b76df82aa3dfe0baab4c6ec.tar.bz2
llvm-49eb628c21b358380b76df82aa3dfe0baab4c6ec.tar.xz
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 'include/llvm/Pass.h')
-rw-r--r--include/llvm/Pass.h41
1 files changed, 12 insertions, 29 deletions
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h
index e92e31b1e9..35ec022516 100644
--- a/include/llvm/Pass.h
+++ b/include/llvm/Pass.h
@@ -104,6 +104,16 @@ public:
return PassID;
}
+ /// doInitialization - Virtual method overridden by subclasses to do
+ /// any necessary initialization before any pass is run.
+ ///
+ virtual bool doInitialization(Module &) { return false; }
+
+ /// doFinalization - Virtual method overriden by subclasses to do any
+ /// necessary clean up after all passes have run.
+ ///
+ virtual bool doFinalization(Module &) { return false; }
+
/// print - Print out the internal state of the pass. This is called by
/// Analyze to print out the contents of an analysis. Otherwise it is not
/// necessary to implement this method. Beware that the module pointer MAY be
@@ -227,20 +237,10 @@ public:
/// createPrinterPass - Get a module printer pass.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
- /// doInitialization - Virtual method overridden by subclasses to do
- /// any necessary initialization before any pass is run.
- ///
- virtual bool doInitialization(Module &) { return false; }
-
/// runOnModule - Virtual method overriden by subclasses to process the module
/// being operated on.
virtual bool runOnModule(Module &M) = 0;
- /// doFinalization - Virtual method overriden by subclasses to do any
- /// necessary clean up after all passes have run.
- ///
- virtual bool doFinalization(Module &) { return false; }
-
virtual void assignPassManager(PMStack &PMS,
PassManagerType T);
@@ -297,21 +297,11 @@ public:
/// createPrinterPass - Get a function printer pass.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
- /// doInitialization - Virtual method overridden by subclasses to do
- /// any necessary per-module initialization.
- ///
- virtual bool doInitialization(Module &);
-
/// runOnFunction - Virtual method overriden by subclasses to do the
/// per-function processing of the pass.
///
virtual bool runOnFunction(Function &F) = 0;
- /// doFinalization - Virtual method overriden by subclasses to do any post
- /// processing needed after all passes have run.
- ///
- virtual bool doFinalization(Module &);
-
virtual void assignPassManager(PMStack &PMS,
PassManagerType T);
@@ -338,10 +328,8 @@ public:
/// createPrinterPass - Get a basic block printer pass.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
- /// doInitialization - Virtual method overridden by subclasses to do
- /// any necessary per-module initialization.
- ///
- virtual bool doInitialization(Module &);
+ using llvm::Pass::doInitialization;
+ using llvm::Pass::doFinalization;
/// doInitialization - Virtual method overridden by BasicBlockPass subclasses
/// to do any necessary per-function initialization.
@@ -358,11 +346,6 @@ public:
///
virtual bool doFinalization(Function &);
- /// doFinalization - Virtual method overriden by subclasses to do any post
- /// processing needed after all passes have run.
- ///
- virtual bool doFinalization(Module &);
-
virtual void assignPassManager(PMStack &PMS,
PassManagerType T);