[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp BasicBlockPlacement.cpp CodeGenPrepare.cpp CondPropagate.cpp ConstantProp.cpp CorrelatedExprs.cpp DCE.cpp DeadStoreElimination.cpp GCSE.cpp IndVarSimplify.cpp InstructionCombining.cpp LICM.cpp LoopRotation.cpp LoopStrengthReduce.cpp LoopUnroll.cpp LoopUnswitch.cpp LowerGC.cpp LowerPacked.cpp PredicateSimplifier.cpp Reassociate.cpp Reg2Mem.cpp SCCP.cpp ScalarReplAggregates.cpp SimplifyCFG.cpp TailDuplication.cpp TailRecursionElimination.cpp

Devang Patel dpatel at apple.com
Tue May 1 14:17:50 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.106 -> 1.107
BasicBlockPlacement.cpp updated: 1.9 -> 1.10
CodeGenPrepare.cpp updated: 1.6 -> 1.7
CondPropagate.cpp updated: 1.18 -> 1.19
ConstantProp.cpp updated: 1.56 -> 1.57
CorrelatedExprs.cpp updated: 1.57 -> 1.58
DCE.cpp updated: 1.63 -> 1.64
DeadStoreElimination.cpp updated: 1.17 -> 1.18
GCSE.cpp updated: 1.53 -> 1.54
IndVarSimplify.cpp updated: 1.115 -> 1.116
InstructionCombining.cpp updated: 1.754 -> 1.755
LICM.cpp updated: 1.96 -> 1.97
LoopRotation.cpp updated: 1.10 -> 1.11
LoopStrengthReduce.cpp updated: 1.131 -> 1.132
LoopUnroll.cpp updated: 1.39 -> 1.40
LoopUnswitch.cpp updated: 1.65 -> 1.66
LowerGC.cpp updated: 1.22 -> 1.23
LowerPacked.cpp updated: 1.21 -> 1.22
PredicateSimplifier.cpp updated: 1.71 -> 1.72
Reassociate.cpp updated: 1.78 -> 1.79
Reg2Mem.cpp updated: 1.12 -> 1.13
SCCP.cpp updated: 1.165 -> 1.166
ScalarReplAggregates.cpp updated: 1.90 -> 1.91
SimplifyCFG.cpp updated: 1.21 -> 1.22
TailDuplication.cpp updated: 1.37 -> 1.38
TailRecursionElimination.cpp updated: 1.30 -> 1.31
---
Log message:

Do not use typeinfo to identify pass in pass manager.


---
Diffs of the changes:  (+114 -5)

 ADCE.cpp                     |    4 ++++
 BasicBlockPlacement.cpp      |    4 ++++
 CodeGenPrepare.cpp           |    6 +++++-
 CondPropagate.cpp            |    5 +++++
 ConstantProp.cpp             |    4 ++++
 CorrelatedExprs.cpp          |    5 +++++
 DCE.cpp                      |    7 +++++++
 DeadStoreElimination.cpp     |    3 +++
 GCSE.cpp                     |    4 ++++
 IndVarSimplify.cpp           |    7 ++++++-
 InstructionCombining.cpp     |    4 ++++
 LICM.cpp                     |    4 ++++
 LoopRotation.cpp             |    5 ++++-
 LoopStrengthReduce.cpp       |    5 ++++-
 LoopUnroll.cpp               |    4 ++++
 LoopUnswitch.cpp             |    4 ++++
 LowerGC.cpp                  |    5 ++++-
 LowerPacked.cpp              |    4 ++++
 PredicateSimplifier.cpp      |    4 ++++
 Reassociate.cpp              |    4 ++++
 Reg2Mem.cpp                  |    3 +++
 SCCP.cpp                     |    7 +++++++
 ScalarReplAggregates.cpp     |    4 ++++
 SimplifyCFG.cpp              |    4 ++++
 TailDuplication.cpp          |    5 +++++
 TailRecursionElimination.cpp |    4 ++++
 26 files changed, 114 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.106 llvm/lib/Transforms/Scalar/ADCE.cpp:1.107
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.106	Wed Apr 18 01:46:57 2007
+++ llvm/lib/Transforms/Scalar/ADCE.cpp	Tue May  1 16:15:47 2007
@@ -52,6 +52,9 @@
   // The public interface for this class
   //
 public:
+  static const int ID; // Pass identifcation, replacement for typeid
+  ADCE() : FunctionPass((intptr_t)&ID) {}
+
   // Execute the Aggressive Dead Code Elimination Algorithm
   //
   virtual bool runOnFunction(Function &F) {
@@ -104,6 +107,7 @@
   }
 };
 
+  const int ADCE::ID = 0;
   RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
 } // End of anonymous namespace
 


Index: llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp
diff -u llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.9 llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.10
--- llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.9	Mon Feb  5 17:32:05 2007
+++ llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp	Tue May  1 16:15:47 2007
@@ -41,6 +41,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    BlockPlacement() : FunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -70,6 +73,7 @@
     void PlaceBlocks(BasicBlock *BB);
   };
 
+  const int BlockPlacement::ID = 0;
   RegisterPass<BlockPlacement> X("block-placement",
                                  "Profile Guided Basic Block Placement");
 }


Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.6 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.7
--- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.6	Tue Apr 24 19:37:04 2007
+++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp	Tue May  1 16:15:47 2007
@@ -39,7 +39,9 @@
     /// transformation profitability.
     const TargetLowering *TLI;
   public:
-    CodeGenPrepare(const TargetLowering *tli = 0) : TLI(tli) {}
+    static const int ID; // Pass identifcation, replacement for typeid
+    CodeGenPrepare(const TargetLowering *tli = 0) : FunctionPass((intptr_t)&ID),
+      TLI(tli) {}
     bool runOnFunction(Function &F);
     
   private:
@@ -52,6 +54,8 @@
                                DenseMap<Value*,Value*> &SunkAddrs);
   };
 }
+
+const int CodeGenPrepare::ID = 0;
 static RegisterPass<CodeGenPrepare> X("codegenprepare",
                                       "Optimize for code generation");
 


Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp
diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.18 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.19
--- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.18	Thu Mar  1 18:28:52 2007
+++ llvm/lib/Transforms/Scalar/CondPropagate.cpp	Tue May  1 16:15:47 2007
@@ -31,6 +31,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN CondProp : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    CondProp() : FunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -45,6 +48,8 @@
     void SimplifyPredecessors(SwitchInst *SI);
     void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB);
   };
+  
+  const int CondProp::ID = 0;
   RegisterPass<CondProp> X("condprop", "Conditional Propagation");
 }
 


Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp
diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.56 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.57
--- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.56	Mon Feb  5 17:32:05 2007
+++ llvm/lib/Transforms/Scalar/ConstantProp.cpp	Tue May  1 16:15:47 2007
@@ -34,6 +34,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    ConstantPropagation() : FunctionPass((intptr_t)&ID) {}
+
     bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -41,6 +44,7 @@
     }
   };
 
+  const int ConstantPropagation::ID = 0;
   RegisterPass<ConstantPropagation> X("constprop",
                                       "Simple constant propagation");
 }


Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.57 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.58
--- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.57	Wed Apr 18 00:25:43 2007
+++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp	Tue May  1 16:15:47 2007
@@ -225,6 +225,9 @@
     std::map<BasicBlock*, RegionInfo> RegionInfoMap;
     ETForest *EF;
   public:
+    static const int ID; // Pass identifcation, replacement for typeid
+    CEE() : FunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnFunction(Function &F);
 
     // We don't modify the program, so we preserve all analyses
@@ -284,6 +287,8 @@
     bool SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI);
     bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI);
   };
+  
+  const int CEE::ID = 0;
   RegisterPass<CEE> X("cee", "Correlated Expression Elimination");
 }
 


Index: llvm/lib/Transforms/Scalar/DCE.cpp
diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.63 llvm/lib/Transforms/Scalar/DCE.cpp:1.64
--- llvm/lib/Transforms/Scalar/DCE.cpp:1.63	Mon Feb  5 17:32:05 2007
+++ llvm/lib/Transforms/Scalar/DCE.cpp	Tue May  1 16:15:47 2007
@@ -35,6 +35,8 @@
   // DeadInstElimination pass implementation
   //
   struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {}
     virtual bool runOnBasicBlock(BasicBlock &BB) {
       bool Changed = false;
       for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); )
@@ -51,6 +53,7 @@
     }
   };
 
+  const int DeadInstElimination::ID = 0;
   RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
 }
 
@@ -64,6 +67,9 @@
   // DeadCodeElimination pass implementation
   //
   struct DCE : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    DCE() : FunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnFunction(Function &F);
 
      virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -71,6 +77,7 @@
     }
  };
 
+  const int DCE::ID = 0;
   RegisterPass<DCE> Y("dce", "Dead Code Elimination");
 }
 


Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.17 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.18
--- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.17	Mon Feb  5 17:32:05 2007
+++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp	Tue May  1 16:15:47 2007
@@ -34,6 +34,8 @@
 
 namespace {
   struct VISIBILITY_HIDDEN DSE : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    DSE() : FunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnFunction(Function &F) {
       bool Changed = false;
@@ -56,6 +58,7 @@
       AU.addPreserved<AliasAnalysis>();
     }
   };
+  const int DSE::ID = 0;
   RegisterPass<DSE> X("dse", "Dead Store Elimination");
 }
 


Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.53 llvm/lib/Transforms/Scalar/GCSE.cpp:1.54
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.53	Sat Apr 14 18:32:02 2007
+++ llvm/lib/Transforms/Scalar/GCSE.cpp	Tue May  1 16:15:47 2007
@@ -37,6 +37,9 @@
                           "with constant values");
 namespace {
   struct VISIBILITY_HIDDEN GCSE : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    GCSE() : FunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnFunction(Function &F);
 
   private:
@@ -51,6 +54,7 @@
     }
   };
 
+  const int GCSE::ID = 0;
   RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
 }
 


Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.115 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.116
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.115	Wed Mar  7 00:39:01 2007
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp	Tue May  1 16:15:47 2007
@@ -68,7 +68,10 @@
     ScalarEvolution *SE;
     bool Changed;
   public:
-    
+
+   static const int ID; // Pass identifcation, replacement for typeid
+   IndVarSimplify() : LoopPass((intptr_t)&ID) {}
+
    bool runOnLoop(Loop *L, LPPassManager &LPM);
    bool doInitialization(Loop *L, LPPassManager &LPM);
    virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -91,6 +94,8 @@
 
     void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
   };
+
+  const int IndVarSimplify::ID = 0;
   RegisterPass<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
 }
 


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.754 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.755
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.754	Sat Apr 28 00:27:36 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Tue May  1 16:15:47 2007
@@ -76,6 +76,9 @@
     TargetData *TD;
     bool MustPreserveLCSSA;
   public:
+    static const int ID; // Pass identifcation, replacement for typeid
+    InstCombiner() : FunctionPass((intptr_t)&ID) {}
+
     /// AddToWorkList - Add the specified instruction to the worklist if it
     /// isn't already in it.
     void AddToWorkList(Instruction *I) {
@@ -358,6 +361,7 @@
     Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned);
   };
 
+  const int InstCombiner::ID = 0;
   RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
 }
 


Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.96 llvm/lib/Transforms/Scalar/LICM.cpp:1.97
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.96	Wed Apr 25 13:32:35 2007
+++ llvm/lib/Transforms/Scalar/LICM.cpp	Tue May  1 16:15:47 2007
@@ -63,6 +63,9 @@
                    cl::desc("Disable memory promotion in LICM pass"));
 
   struct VISIBILITY_HIDDEN LICM : public LoopPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    LICM() : LoopPass((intptr_t)&ID) {}
+
     virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
 
     /// This transformation requires natural loop information & requires that
@@ -201,6 +204,7 @@
                                     std::map<Value*, AllocaInst*> &Val2AlMap);
   };
 
+  const int LICM::ID = 0;
   RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
 }
 


Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.10 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.11
--- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.10	Sat Apr 14 18:32:02 2007
+++ llvm/lib/Transforms/Scalar/LoopRotation.cpp	Tue May  1 16:15:47 2007
@@ -44,7 +44,9 @@
   class VISIBILITY_HIDDEN LoopRotate : public LoopPass {
 
   public:
-    
+    static const int ID; // Pass ID, replacement for typeid
+    LoopRotate() : LoopPass((intptr_t)&ID) {}
+
     // Rotate Loop L as many times as possible. Return true if
     // loop is rotated at least once.
     bool runOnLoop(Loop *L, LPPassManager &LPM);
@@ -92,6 +94,7 @@
     SmallVector<RenameData, MAX_HEADER_SIZE> LoopHeaderInfo;
   };
   
+  const int LoopRotate::ID = 0;
   RegisterPass<LoopRotate> X ("loop-rotate", "Rotate Loops");
 }
 


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.131 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.132
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.131	Mon Apr 23 17:42:03 2007
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp	Tue May  1 16:15:47 2007
@@ -143,7 +143,9 @@
     const TargetLowering *TLI;
 
   public:
-    LoopStrengthReduce(const TargetLowering *tli = NULL) : TLI(tli) {
+    static const int ID; // Pass ID, replacement for typeid
+    LoopStrengthReduce(const TargetLowering *tli = NULL) : 
+      LoopPass((intptr_t)&ID), TLI(tli) {
     }
 
     bool runOnLoop(Loop *L, LPPassManager &LPM);
@@ -186,6 +188,7 @@
                                       Loop *L, bool isOnlyStride);
     void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
   };
+  const int LoopStrengthReduce::ID = 0;
   RegisterPass<LoopStrengthReduce> X("loop-reduce", "Loop Strength Reduction");
 }
 


Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.39 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.40
--- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.39	Mon Apr 16 18:03:45 2007
+++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp	Tue May  1 16:15:47 2007
@@ -49,6 +49,9 @@
   class VISIBILITY_HIDDEN LoopUnroll : public LoopPass {
     LoopInfo *LI;  // The current loop information
   public:
+    static const int ID; // Pass ID, replacement for typeid
+    LoopUnroll()  : LoopPass((intptr_t)&ID) {}
+
     bool runOnLoop(Loop *L, LPPassManager &LPM);
     BasicBlock* FoldBlockIntoPredecessor(BasicBlock* BB);
 
@@ -63,6 +66,7 @@
       AU.addPreserved<LoopInfo>();
     }
   };
+  const int LoopUnroll::ID = 0;
   RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
 }
 


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.65 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.66
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.65	Tue Mar  6 18:26:10 2007
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp	Tue May  1 16:15:47 2007
@@ -69,6 +69,9 @@
     SmallPtrSet<Value *,8> UnswitchedVals;
 
   public:
+    static const int ID; // Pass ID, replacement for typeid
+    LoopUnswitch() : LoopPass((intptr_t)&ID) {}
+
     bool runOnLoop(Loop *L, LPPassManager &LPM);
 
     /// This transformation requires natural loop information & requires that
@@ -109,6 +112,7 @@
                            std::vector<Instruction*> &Worklist);
     void RemoveLoopFromHierarchy(Loop *L);
   };
+  const int LoopUnswitch::ID = 0;
   RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
 }
 


Index: llvm/lib/Transforms/Scalar/LowerGC.cpp
diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.22 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.23
--- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.22	Mon Feb 12 20:10:56 2007
+++ llvm/lib/Transforms/Scalar/LowerGC.cpp	Tue May  1 16:15:47 2007
@@ -47,7 +47,9 @@
     /// had zero roots.
     const Type *MainRootRecordType;
   public:
-    LowerGC() : GCRootInt(0), GCReadInt(0), GCWriteInt(0),
+    static const int ID; // Pass identifcation, replacement for typeid
+    LowerGC() : FunctionPass((intptr_t)&ID), 
+                GCRootInt(0), GCReadInt(0), GCWriteInt(0),
                 GCRead(0), GCWrite(0), RootChain(0), MainRootRecordType(0) {}
     virtual bool doInitialization(Module &M);
     virtual bool runOnFunction(Function &F);
@@ -56,6 +58,7 @@
     const StructType *getRootRecordType(unsigned NumRoots);
   };
 
+  const int LowerGC::ID = 0;
   RegisterPass<LowerGC>
   X("lowergc", "Lower GC intrinsics, for GCless code generators");
 }


Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp
diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.21 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.22
--- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.21	Mon Apr 16 13:10:23 2007
+++ llvm/lib/Transforms/Scalar/LowerPacked.cpp	Tue May  1 16:15:47 2007
@@ -40,6 +40,9 @@
 class VISIBILITY_HIDDEN LowerPacked 
   : public FunctionPass, public InstVisitor<LowerPacked> {
 public:
+    static const int ID; // Pass identifcation, replacement for typeid
+    LowerPacked() : FunctionPass((intptr_t)&ID) {}
+
    /// @brief Lowers packed operations to scalar operations.
    /// @param F The fuction to process
    virtual bool runOnFunction(Function &F);
@@ -104,6 +107,7 @@
    std::vector<Instruction*> instrsToRemove;
 };
 
+const int LowerPacked::ID = 0;
 RegisterPass<LowerPacked>
 X("lower-packed",
   "lowers packed operations to operations on smaller packed datatypes");


Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.71 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.72
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.71	Thu Apr 26 11:42:07 2007
+++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp	Tue May  1 16:15:47 2007
@@ -1989,6 +1989,9 @@
     std::vector<DominatorTree::Node *> WorkList;
 
   public:
+    static const int ID; // Pass identifcation, replacement for typeid
+    PredicateSimplifier() : FunctionPass((intptr_t)&ID) {}
+
     bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -2374,6 +2377,7 @@
     }
   }
 
+  const int PredicateSimplifier::ID = 0;
   RegisterPass<PredicateSimplifier> X("predsimplify",
                                       "Predicate Simplifier");
 }


Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.78 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.79
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.78	Thu Mar  1 18:28:52 2007
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp	Tue May  1 16:15:47 2007
@@ -69,6 +69,9 @@
     std::map<Value*, unsigned> ValueRankMap;
     bool MadeChange;
   public:
+    static const int ID; // Pass identifcation, replacement for typeid
+    Reassociate() : FunctionPass((intptr_t)&ID) {}
+
     bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -89,6 +92,7 @@
     void RemoveDeadBinaryOp(Value *V);
   };
 
+  const int Reassociate::ID = 0;
   RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
 }
 


Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp
diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.12 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.13
--- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.12	Mon Apr 16 13:10:23 2007
+++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp	Tue May  1 16:15:47 2007
@@ -33,6 +33,8 @@
 
 namespace {
   struct VISIBILITY_HIDDEN RegToMem : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    RegToMem() : FunctionPass((intptr_t)&ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequiredID(BreakCriticalEdgesID);
@@ -76,6 +78,7 @@
     }
   };
   
+  const int RegToMem::ID = 0;
   RegisterPass<RegToMem> X("reg2mem", "Demote all values to stack slots");
 }
 


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.165 llvm/lib/Transforms/Scalar/SCCP.cpp:1.166
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.165	Sat Apr 14 18:32:02 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp	Tue May  1 16:15:47 2007
@@ -1334,6 +1334,9 @@
   /// Sparse Conditional Constant Propagator.
   ///
   struct VISIBILITY_HIDDEN SCCP : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    SCCP() : FunctionPass((intptr_t)&ID) {}
+
     // runOnFunction - Run the Sparse Conditional Constant Propagation
     // algorithm, and return true if the function was modified.
     //
@@ -1344,6 +1347,7 @@
     }
   };
 
+  const int SCCP::ID = 0;
   RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
 } // end anonymous namespace
 
@@ -1443,9 +1447,12 @@
   /// Constant Propagation.
   ///
   struct VISIBILITY_HIDDEN IPSCCP : public ModulePass {
+    static const int ID;
+    IPSCCP() : ModulePass((intptr_t)&ID) {}
     bool runOnModule(Module &M);
   };
 
+  const int IPSCCP::ID = 0;
   RegisterPass<IPSCCP>
   Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
 } // end anonymous namespace


Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.90 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.91
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.90	Wed Apr 25 13:32:35 2007
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp	Tue May  1 16:15:47 2007
@@ -47,6 +47,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN SROA : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    SROA() : FunctionPass((intptr_t)&ID) {}
+
     bool runOnFunction(Function &F);
 
     bool performScalarRepl(Function &F);
@@ -81,6 +84,7 @@
     static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI);
   };
 
+  const int SROA::ID = 0;
   RegisterPass<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
 }
 


Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp
diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.21 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.22
--- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.21	Wed Apr  4 20:27:02 2007
+++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp	Tue May  1 16:15:47 2007
@@ -35,8 +35,12 @@
 
 namespace {
   struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnFunction(Function &F);
   };
+  const int CFGSimplifyPass::ID = 0;
   RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
 }
 


Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp
diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.37 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.38
--- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.37	Mon Feb  5 17:32:05 2007
+++ llvm/lib/Transforms/Scalar/TailDuplication.cpp	Tue May  1 16:15:47 2007
@@ -42,10 +42,15 @@
             cl::init(6), cl::Hidden);
   class VISIBILITY_HIDDEN TailDup : public FunctionPass {
     bool runOnFunction(Function &F);
+  public:
+    static const int ID; // Pass identifcation, replacement for typeid
+    TailDup() : FunctionPass((intptr_t)&ID) {}
+
   private:
     inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI);
     inline void eliminateUnconditionalBranch(BranchInst *BI);
   };
+  const int TailDup::ID = 0;
   RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
 }
 


Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.30 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.31
--- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.30	Thu Mar 22 11:38:57 2007
+++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp	Tue May  1 16:15:47 2007
@@ -67,6 +67,9 @@
 
 namespace {
   struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    TailCallElim() : FunctionPass((intptr_t)&ID) {}
+
     virtual bool runOnFunction(Function &F);
 
   private:
@@ -77,6 +80,7 @@
     bool CanMoveAboveCall(Instruction *I, CallInst *CI);
     Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI);
   };
+  const int TailCallElim::ID = 0;
   RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
 }
 






More information about the llvm-commits mailing list