diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-07 08:11:11 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-07 08:11:11 +0000 |
commit | ce20771ec2fd95cf3a7f9d0ad95717c2e83b5324 (patch) | |
tree | 5f97d9e1f2d7e16293ec56d61795624376245580 /include/llvm/Pass.h | |
parent | 7506b1d6989939cdf2770194f98cfe8106f0fca5 (diff) | |
download | external_llvm-ce20771ec2fd95cf3a7f9d0ad95717c2e83b5324.zip external_llvm-ce20771ec2fd95cf3a7f9d0ad95717c2e83b5324.tar.gz external_llvm-ce20771ec2fd95cf3a7f9d0ad95717c2e83b5324.tar.bz2 |
For PR387:\
Add runPass methods to remove -Woverloaded-virtual warnings are not \
present and circumvent possible inheritance bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Pass.h')
-rw-r--r-- | include/llvm/Pass.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 0855986..e6083a3 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -87,7 +87,8 @@ public: /// runPass - Run this pass, returning true if a modification was made to the /// module argument. This should be implemented by all concrete subclasses. /// - virtual bool runPass(Module &M) = 0; + virtual bool runPass(Module &M) { return false; } + virtual bool runPass(BasicBlock&) { 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 @@ -216,7 +217,8 @@ public: /// being operated on. virtual bool runOnModule(Module &M) = 0; - bool runPass(Module &M) { return runOnModule(M); } + virtual bool runPass(Module &M) { return runOnModule(M); } + virtual bool runPass(BasicBlock&) { return false; } virtual void addToPassManager(PassManagerT<Module> *PM, AnalysisUsage &AU); }; @@ -338,7 +340,8 @@ struct BasicBlockPass : public FunctionPass { /// To run directly on the basic block, we initialize, runOnBasicBlock, then /// finalize. /// - bool runPass(BasicBlock &BB); + virtual bool runPass(Module &M) { return false; } + virtual bool runPass(BasicBlock &BB); private: friend class PassManagerT<Function>; |