[llvm-commits] CVS: llvm/lib/Transforms/IPO/LoopExtractor.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Mar 13 22:02:01 PST 2004
Changes in directory llvm/lib/Transforms/IPO:
LoopExtractor.cpp updated: 1.3 -> 1.4
---
Log message:
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
---
Diffs of the changes: (+2 -8)
Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp
diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.3 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.4
--- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.3 Sat Mar 13 20:37:16 2004
+++ llvm/lib/Transforms/IPO/LoopExtractor.cpp Sat Mar 13 22:01:06 2004
@@ -18,30 +18,24 @@
#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);
}
};
RegisterOpt<LoopExtractor>
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";
More information about the llvm-commits
mailing list