*** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3016 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp
index c419ad1..494b363 100644
--- a/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/lib/Transforms/IPO/GlobalDCE.cpp
@@ -70,8 +70,6 @@
 
 namespace {
   struct GlobalDCE : public Pass {
-    const char *getPassName() const { return "Dead Global Elimination"; }
-
     // run - Do the GlobalDCE pass on the specified module, optionally updating
     // the specified callgraph to reflect the changes.
     //
@@ -88,6 +86,7 @@
       AU.addRequired(CallGraph::ID);
     }
   };
+  RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
 }
 
 Pass *createGlobalDCEPass() { return new GlobalDCE(); }
diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp
index ff0b790..6be64fc 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -14,9 +14,8 @@
 
 static Statistic<> NumChanged("internalize\t- Number of functions internal'd");
 
+namespace {
 class InternalizePass : public Pass {
-  const char *getPassName() const { return "Internalize Functions"; }
-
   virtual bool run(Module &M) {
     bool FoundMain = false;   // Look for a function named main...
     for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
@@ -42,6 +41,9 @@
   }
 };
 
+RegisterPass<InternalizePass> X("internalize", "Internalize Functions");
+} // end anonymous namespace
+
 Pass *createInternalizePass() {
   return new InternalizePass();
 }
diff --git a/lib/Transforms/IPO/OldPoolAllocate.cpp b/lib/Transforms/IPO/OldPoolAllocate.cpp
index eb463b8..dca8b97 100644
--- a/lib/Transforms/IPO/OldPoolAllocate.cpp
+++ b/lib/Transforms/IPO/OldPoolAllocate.cpp
@@ -207,8 +207,6 @@
 
   // Define the pass class that we implement...
   struct PoolAllocate : public Pass {
-    const char *getPassName() const { return "Pool Allocate"; }
-
     PoolAllocate() {
       switch (ReqPointerSize) {
       case Ptr32bits: POINTERTYPE = Type::UIntTy; break;
@@ -316,6 +314,9 @@
                            map<DSNode*, PoolInfo> &PoolDescs);
 
   };
+
+  RegisterPass<PoolAllocate> X("poolalloc",
+                               "Pool allocate disjoint datastructures");
 }
 
 // isNotPoolableAlloc - This is a predicate that returns true if the specified
diff --git a/lib/Transforms/Instrumentation/EmitFunctions.cpp b/lib/Transforms/Instrumentation/EmitFunctions.cpp
index 2d9b9a7..3506cb9 100644
--- a/lib/Transforms/Instrumentation/EmitFunctions.cpp
+++ b/lib/Transforms/Instrumentation/EmitFunctions.cpp
@@ -12,11 +12,13 @@
 
 using std::vector;
 
-struct EmitFunctionTable : public Pass {
-  const char *getPassName() const { return "EmitFunctionTablePass"; }
-
-  bool run(Module &M);
-};
+namespace {
+  struct EmitFunctionTable : public Pass {
+    bool run(Module &M);
+  };
+  
+  RegisterPass<EmitFunctionTable> X("emitfuncs", "Emit a Function Table");
+}
 
 // Create a new pass to add function table
 //
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
index 391bc5b..95cd5be 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
@@ -37,8 +37,6 @@
 using std::vector;
 
 struct ProfilePaths : public FunctionPass {
-  const char *getPassName() const { return "ProfilePaths"; }
-
   bool runOnFunction(Function &F);
 
   // Before this pass, make sure that there is only one 
@@ -49,6 +47,8 @@
   }
 };
 
+static RegisterPass<ProfilePaths> X("paths", "Profile Paths");
+
 // createProfilePathsPass - Create a new pass to add path profiling
 //
 Pass *createProfilePathsPass() {
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index 35189e3..d70980e 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -43,8 +43,6 @@
   // The public interface for this class
   //
 public:
-  const char *getPassName() const { return "Aggressive Dead Code Elimination"; }
-  
   // Execute the Aggressive Dead Code Elimination Algorithm
   //
   virtual bool runOnFunction(Function &F) {
@@ -86,11 +84,11 @@
   }
 };
 
+  RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
 } // End of anonymous namespace
 
 Pass *createAggressiveDCEPass() { return new ADCE(); }
 
-
 void ADCE::markBlockAlive(BasicBlock *BB) {
   // Mark the basic block as being newly ALIVE... and mark all branches that
   // this block is control dependant on as being alive also...
diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp
index 51bd6cb..025b8a7 100644
--- a/lib/Transforms/Scalar/ConstantProp.cpp
+++ b/lib/Transforms/Scalar/ConstantProp.cpp
@@ -24,14 +24,14 @@
 
 namespace {
   struct ConstantPropogation : public FunctionPass {
-    const char *getPassName() const { return "Simple Constant Propogation"; }
-
     bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.preservesCFG();
     }
   };
+
+RegisterPass<ConstantPropogation> X("constprop", "Simple constant propogation");
 }
 
 Pass *createConstantPropogationPass() {
diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp
index 1f5def6..bfc41b14 100644
--- a/lib/Transforms/Scalar/DCE.cpp
+++ b/lib/Transforms/Scalar/DCE.cpp
@@ -26,8 +26,6 @@
 
 namespace {
   struct DeadInstElimination : public BasicBlockPass {
-    const char *getPassName() const { return "Dead Instruction Elimination"; }
-    
     virtual bool runOnBasicBlock(BasicBlock &BB) {
       bool Changed = false;
       for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); )
@@ -43,6 +41,8 @@
       AU.preservesCFG();
     }
   };
+  
+  RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
 }
 
 Pass *createDeadInstEliminationPass() {
@@ -57,14 +57,14 @@
 
 namespace {
   struct DCE : public FunctionPass {
-    const char *getPassName() const { return "Dead Code Elimination"; }
-
     virtual bool runOnFunction(Function &F);
 
      virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.preservesCFG();
     }
  };
+
+  RegisterPass<DCE> Y("dce", "Dead Code Elimination");
 }
 
 bool DCE::runOnFunction(Function &F) {
diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
index b180950..5d873cd 100644
--- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
+++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
@@ -21,13 +21,14 @@
 
 namespace {
   struct DecomposePass : public BasicBlockPass {
-    const char *getPassName() const { return "Decompose Subscripting Exps"; }
-
     virtual bool runOnBasicBlock(BasicBlock &BB);
 
   private:
     static void decomposeArrayRef(BasicBlock::iterator &BBI);
   };
+
+RegisterPass<DecomposePass> X("lowerrefs", "Decompose multi-dimensional "
+                              "structure/array references");
 }
 
 Pass *createDecomposeMultiDimRefsPass() {
diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp
index 56bb191..568f3db 100644
--- a/lib/Transforms/Scalar/GCSE.cpp
+++ b/lib/Transforms/Scalar/GCSE.cpp
@@ -42,10 +42,6 @@
     //
     map<BasicBlock*, bool>  BBContainsStore;
   public:
-    const char *getPassName() const {
-      return "Global Common Subexpression Elimination";
-    }
-
     virtual bool runOnFunction(Function &F);
 
     // Visitation methods, these are invoked depending on the type of
@@ -87,6 +83,8 @@
       AU.addRequired(ImmediateDominators::ID); 
     }
   };
+
+  RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
 }
 
 // createGCSEPass - The public interface to this file...
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index acd1deb..35fe697 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -184,10 +184,6 @@
 
 namespace {
   struct InductionVariableSimplify : public FunctionPass {
-    const char *getPassName() const {
-      return "Induction Variable Cannonicalize";
-    }
-
     virtual bool runOnFunction(Function &) {
       LoopInfo &LI = getAnalysis<LoopInfo>();
 
@@ -202,9 +198,10 @@
       AU.preservesCFG();
     }
   };
+  RegisterPass<InductionVariableSimplify> X("indvars",
+                                           "Cannonicalize Induction Variables");
 }
 
 Pass *createIndVarSimplifyPass() {
   return new InductionVariableSimplify();
 }
-
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 1ff2c0f..ba2bbe0 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -46,8 +46,6 @@
     }
 
   public:
-    const char *getPassName() const { return "Instruction Combining"; }
-
     virtual bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -80,6 +78,8 @@
     // visitInstruction - Specify what to return for unhandled instructions...
     Instruction *visitInstruction(Instruction &I) { return 0; }
   };
+
+  RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
 }
 
 
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 99ee45e..99450bb 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -34,8 +34,6 @@
 
 namespace {
   struct LICM : public FunctionPass, public InstVisitor<LICM> {
-    const char *getPassName() const { return "Loop Invariant Code Motion"; }
-
     virtual bool runOnFunction(Function &F);
 
     // This transformation requires natural loop information...
@@ -104,6 +102,8 @@
       hoist(I);
     }
   };
+
+  RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
 }
 
 Pass *createLICMPass() { return new LICM(); }
diff --git a/lib/Transforms/Scalar/PiNodeInsertion.cpp b/lib/Transforms/Scalar/PiNodeInsertion.cpp
index 2c16049..81f3cb3 100644
--- a/lib/Transforms/Scalar/PiNodeInsertion.cpp
+++ b/lib/Transforms/Scalar/PiNodeInsertion.cpp
@@ -40,8 +40,6 @@
 
 namespace {
   struct PiNodeInserter : public FunctionPass {
-    const char *getPassName() const { return "Pi Node Insertion"; }
-    
     virtual bool runOnFunction(Function &F);
     
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -56,6 +54,8 @@
     //
     bool insertPiNodeFor(Value *V, BasicBlock *BB, Value *Rep = 0);
   };
+
+  RegisterPass<PiNodeInserter> X("pinodes", "Pi Node Insertion");
 }
 
 Pass *createPiNodeInsertionPass() { return new PiNodeInserter(); }
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 7ccbd7b..0575803 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -35,10 +35,6 @@
   class Reassociate : public FunctionPass {
     map<BasicBlock*, unsigned> RankMap;
   public:
-    const char *getPassName() const {
-      return "Expression Reassociation";
-    }
-
     bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -50,6 +46,8 @@
     bool ReassociateExpr(BinaryOperator *I);
     bool ReassociateBB(BasicBlock *BB);
   };
+
+  RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
 }
 
 Pass *createReassociatePass() { return new Reassociate(); }
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 4d752e9..b32481e 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -94,10 +94,6 @@
   std::vector<BasicBlock*>  BBWorkList;  // The BasicBlock work list
 public:
 
-  const char *getPassName() const {
-    return "Sparse Conditional Constant Propogation";
-  }
-
   // runOnFunction - Run the Sparse Conditional Constant Propogation algorithm,
   // and return true if the function was modified.
   //
@@ -223,6 +219,8 @@
     visit(I);
   }
 };
+
+  RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propogation");
 } // end anonymous namespace
 
 
@@ -233,7 +231,6 @@
 }
 
 
-
 //===----------------------------------------------------------------------===//
 // SCCP Class Implementation
 
diff --git a/lib/Transforms/Scalar/SimplifyCFG.cpp b/lib/Transforms/Scalar/SimplifyCFG.cpp
index 08611d2..6774dc1 100644
--- a/lib/Transforms/Scalar/SimplifyCFG.cpp
+++ b/lib/Transforms/Scalar/SimplifyCFG.cpp
@@ -24,10 +24,9 @@
 
 namespace {
   struct CFGSimplifyPass : public FunctionPass {
-    const char *getPassName() const { return "Simplify CFG"; }
-    
     virtual bool runOnFunction(Function &F);
   };
+  RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
 }
 
 Pass *createCFGSimplificationPass() {
diff --git a/lib/Transforms/Scalar/SymbolStripping.cpp b/lib/Transforms/Scalar/SymbolStripping.cpp
index 46f4e44..4ad5af3 100644
--- a/lib/Transforms/Scalar/SymbolStripping.cpp
+++ b/lib/Transforms/Scalar/SymbolStripping.cpp
@@ -44,8 +44,6 @@
 
 namespace {
   struct SymbolStripping : public FunctionPass {
-    const char *getPassName() const { return "Strip Symbols from Functions"; }
-
     virtual bool runOnFunction(Function &F) {
       return StripSymbolTable(F.getSymbolTable());
     }
@@ -53,13 +51,15 @@
       AU.setPreservesAll();
     }
   };
+  RegisterPass<SymbolStripping> X("strip", "Strip symbols from functions");
 
   struct FullSymbolStripping : public SymbolStripping {
-    const char *getPassName() const { return "Strip Symbols from Module"; }
     virtual bool doInitialization(Module &M) {
       return StripSymbolTable(M.getSymbolTable());
     }
   };
+  RegisterPass<FullSymbolStripping> Y("mstrip",
+                                    "Strip symbols from module and functions");
 }
 
 Pass *createSymbolStrippingPass() {
diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 8a81ac7..378e979 100644
--- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -47,8 +47,6 @@
     map<BasicBlock*,vector<PHINode*> > NewPhiNodes; // the PhiNodes we're adding
 
   public:
-    const char *getPassName() const { return "Promote Memory to Register"; }
-
     // runOnFunction - To run this pass, first we calculate the alloca
     // instructions that are safe for promotion, then we promote each one.
     //
@@ -68,6 +66,7 @@
     void FindSafeAllocas(Function &F);
   };
 
+  RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
 }  // end of anonymous namespace
 
 
diff --git a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
index 9a65fce..ef7d63e 100644
--- a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+++ b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
@@ -17,6 +17,8 @@
 
 AnalysisID UnifyFunctionExitNodes::ID(AnalysisID::create<UnifyFunctionExitNodes>());
 
+static RegisterPass<UnifyFunctionExitNodes>
+X("mergereturn", "Unify function exit nodes");
 
 // UnifyAllExitNodes - Unify all exit nodes of the CFG by creating a new
 // BasicBlock, and converting all returns to unconditional branches to this