Change create*Pass factory functions to return Pass* instead of
authorDaniel Dunbar <daniel@zuster.org>
Wed, 22 Oct 2008 23:32:42 +0000 (23:32 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 22 Oct 2008 23:32:42 +0000 (23:32 +0000)
LoopPass*.
 - Although less precise, this means they can be used in clients
   without RTTI (who would otherwise need to include LoopPass.h, which
   eventually includes things using dynamic_cast). This was the
   simplest solution that presented itself, but I am happy to use a
   better one if available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58010 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Scalar.h
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoopDeletion.cpp
lib/Transforms/Scalar/LoopIndexSplit.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/LoopUnroll.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
lib/Transforms/Utils/LCSSA.cpp

index 2a586fd06958d9dcfcb8fd80953f1b487fe387b6..74bbfa5b9de666a4c04c2df5d29d033f27668e89 100644 (file)
@@ -18,7 +18,6 @@
 namespace llvm {
 
 class FunctionPass;
-class LoopPass;
 class Pass;
 class GetElementPtrInst;
 class PassInfo;
@@ -81,7 +80,7 @@ FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1);
 // InductionVariableSimplify - Transform induction variables in a program to all
 // use a single canonical induction variable per loop.
 //
-LoopPass *createIndVarSimplifyPass();
+Pass *createIndVarSimplifyPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -101,7 +100,7 @@ FunctionPass *createInstructionCombiningPass();
 //
 // LICM - This pass is a loop invariant code motion and memory promotion pass.
 //
-LoopPass *createLICMPass();
+Pass *createLICMPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -110,32 +109,32 @@ LoopPass *createLICMPass();
 // optional parameter used to consult the target machine whether certain
 // transformations are profitable.
 //
-LoopPass *createLoopStrengthReducePass(const TargetLowering *TLI = 0);
+Pass *createLoopStrengthReducePass(const TargetLowering *TLI = 0);
 
 //===----------------------------------------------------------------------===//
 //
 // LoopUnswitch - This pass is a simple loop unswitching pass.
 //
-LoopPass *createLoopUnswitchPass(bool OptimizeForSize = false);
+Pass *createLoopUnswitchPass(bool OptimizeForSize = false);
 
 //===----------------------------------------------------------------------===//
 //
 // LoopUnroll - This pass is a simple loop unrolling pass.
 //
-LoopPass *createLoopUnrollPass();
+Pass *createLoopUnrollPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopRotate - This pass is a simple loop rotating pass.
 //
-LoopPass *createLoopRotatePass();
+Pass *createLoopRotatePass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopIndexSplit - This pass divides loop's iteration range by spliting loop
 // such that each individual loop is executed efficiently.
 //
-LoopPass *createLoopIndexSplitPass();
+Pass *createLoopIndexSplitPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -274,7 +273,7 @@ FunctionPass *createBlockPlacementPass();
 // LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
 // optimizations.
 //
-LoopPass *createLCSSAPass();
+Pass *createLCSSAPass();
 extern const PassInfo *const LCSSAID;
 
 //===----------------------------------------------------------------------===//
@@ -310,7 +309,7 @@ FunctionPass *createMemCpyOptPass();
 // LoopDeletion - This pass performs DCE of non-infinite loops that it
 // can prove are dead.
 //
-LoopPass *createLoopDeletionPass();
+Pass *createLoopDeletionPass();
   
 //===----------------------------------------------------------------------===//
 //
index 13be455c4d0b590c0ca017865367536b775dc2ce..4dfd8b920b6e5cf19d0e4951b5b00e2b80a06af2 100644 (file)
@@ -102,7 +102,7 @@ char IndVarSimplify::ID = 0;
 static RegisterPass<IndVarSimplify>
 X("indvars", "Canonicalize Induction Variables");
 
-LoopPass *llvm::createIndVarSimplifyPass() {
+Pass *llvm::createIndVarSimplifyPass() {
   return new IndVarSimplify();
 }
 
index 3eee4a27f7d6eda3bd1ebbd58563454c08b2df5f..b5d5bfda6f4288a9ef08116a550aaef52d393d68 100644 (file)
@@ -230,7 +230,7 @@ namespace {
 char LICM::ID = 0;
 static RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
 
-LoopPass *llvm::createLICMPass() { return new LICM(); }
+Pass *llvm::createLICMPass() { return new LICM(); }
 
 /// Hoist expressions out of the specified loop. Note, alias info for inner
 /// loop is not preserved so it is not a good idea to run LICM multiple 
index 74190f5f7769dea81bb6aaac19310b38ac1a72b4..86edcfaac80db122d3a914ffc5754d7c4dff475b 100644 (file)
@@ -60,7 +60,7 @@ namespace {
 char LoopDeletion::ID = 0;
 static RegisterPass<LoopDeletion> X("loop-deletion", "Delete dead loops");
 
-LoopPass* llvm::createLoopDeletionPass() {
+Pass* llvm::createLoopDeletionPass() {
   return new LoopDeletion();
 }
 
index 6a2c7587f6e02f1e99b8c65206716a071533a7d9..9a5920c8b97dd9642cb9c7c9103ca87c1bd08fe6 100644 (file)
@@ -205,7 +205,7 @@ char LoopIndexSplit::ID = 0;
 static RegisterPass<LoopIndexSplit>
 X("loop-index-split", "Index Split Loops");
 
-LoopPass *llvm::createLoopIndexSplitPass() {
+Pass *llvm::createLoopIndexSplitPass() {
   return new LoopIndexSplit();
 }
 
index 488ab0eacff4fd4a17a25767cb82baea1fb50ec9..e8df49b6e4e5325985111219209c77bb3cc6b3a2 100644 (file)
@@ -107,7 +107,7 @@ namespace {
 char LoopRotate::ID = 0;
 static RegisterPass<LoopRotate> X("loop-rotate", "Rotate Loops");
 
-LoopPass *llvm::createLoopRotatePass() { return new LoopRotate(); }
+Pass *llvm::createLoopRotatePass() { return new LoopRotate(); }
 
 /// Rotate Loop L as many times as possible. Return true if
 /// loop is rotated at least once.
index 30e86447f25baf304f430cc8850b43227e6e9faf..9052d6088e35349edd559c82e06905f1d99bd7f6 100644 (file)
@@ -213,7 +213,7 @@ char LoopStrengthReduce::ID = 0;
 static RegisterPass<LoopStrengthReduce>
 X("loop-reduce", "Loop Strength Reduction");
 
-LoopPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
+Pass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
   return new LoopStrengthReduce(TLI);
 }
 
index ed4ea895cc26f5c0aa073a3c7a4ca75d1a23c62a..6d685d58f96b47079ee05e128925419ff58fbd86 100644 (file)
@@ -73,7 +73,7 @@ namespace {
 char LoopUnroll::ID = 0;
 static RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
 
-LoopPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }
+Pass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }
 
 /// ApproximateLoopSize - Approximate the size of the loop.
 static unsigned ApproximateLoopSize(const Loop *L) {
index 455338b3341d54d0716a5d8f9f69a7621610a2cc..65034f5577cb2a90407d9fa553072cfd6cd7584c 100644 (file)
@@ -154,7 +154,7 @@ namespace {
 char LoopUnswitch::ID = 0;
 static RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
 
-LoopPass *llvm::createLoopUnswitchPass(bool Os) { 
+Pass *llvm::createLoopUnswitchPass(bool Os) { 
   return new LoopUnswitch(Os); 
 }
 
index bcba3c13990619e47b5f2ca3033b6d0db76b5142..385588861154b2ac3aeb0cbfcdb00b3b3f71bcee 100644 (file)
@@ -99,7 +99,7 @@ namespace {
 char LCSSA::ID = 0;
 static RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
 
-LoopPass *llvm::createLCSSAPass() { return new LCSSA(); }
+Pass *llvm::createLCSSAPass() { return new LCSSA(); }
 const PassInfo *const llvm::LCSSAID = &X;
 
 /// runOnFunction - Process all loops in the function, inner-most out.