diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-14 04:01:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-14 04:01:06 +0000 |
commit | 16d0eb04688d283dc70a8f4a9905cb19d8636cd2 (patch) | |
tree | 0b999c1bcb875625add0d331dd0a5f08b1cb04e9 | |
parent | 2ef703ec429900c5b49d94d82332e7a216a2d7c4 (diff) | |
download | external_llvm-16d0eb04688d283dc70a8f4a9905cb19d8636cd2.zip external_llvm-16d0eb04688d283dc70a8f4a9905cb19d8636cd2.tar.gz external_llvm-16d0eb04688d283dc70a8f4a9905cb19d8636cd2.tar.bz2 |
FunctionPass's should not define their own 'run' method.
Require 'simplified' loops, not just raw natural loops. This fixes
CodeExtractor/2004-03-13-LoopExtractorCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12381 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/IPO/LoopExtractor.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp index 3aa5686..5e7dbc6 100644 --- a/lib/Transforms/IPO/LoopExtractor.cpp +++ b/lib/Transforms/IPO/LoopExtractor.cpp @@ -18,17 +18,18 @@ #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/FunctionUtils.h" using namespace llvm; namespace { // FIXME: PassManager should allow Module passes to require FunctionPasses struct LoopExtractor : public FunctionPass { - virtual bool run(Module &M); virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<LoopInfo>(); + AU.addRequiredID(LoopSimplifyID); } }; @@ -36,13 +37,6 @@ namespace { X("loop-extract", "Extract loops into new functions"); } // End anonymous namespace -bool LoopExtractor::run(Module &M) { - bool Changed = false; - for (Module::iterator i = M.begin(), e = M.end(); i != e; ++i) - Changed |= runOnFunction(*i); - return Changed; -} - bool LoopExtractor::runOnFunction(Function &F) { std::cerr << F.getName() << "\n"; |