[llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp ConstantMerge.cpp DeadArgumentElimination.cpp DeadTypeElimination.cpp FunctionResolution.cpp GlobalDCE.cpp GlobalOpt.cpp IPConstantPropagation.cpp IndMemRemoval.cpp InlineSimple.cpp Internalize.cpp LoopExtractor.cpp LowerSetJmp.cpp PruneEH.cpp RaiseAllocations.cpp SimplifyLibCalls.cpp StripSymbols.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 27 15:43:25 PDT 2006



Changes in directory llvm/lib/Transforms/IPO:

ArgumentPromotion.cpp updated: 1.21 -> 1.22
ConstantMerge.cpp updated: 1.31 -> 1.32
DeadArgumentElimination.cpp updated: 1.27 -> 1.28
DeadTypeElimination.cpp updated: 1.55 -> 1.56
FunctionResolution.cpp updated: 1.59 -> 1.60
GlobalDCE.cpp updated: 1.37 -> 1.38
GlobalOpt.cpp updated: 1.62 -> 1.63
IPConstantPropagation.cpp updated: 1.18 -> 1.19
IndMemRemoval.cpp updated: 1.2 -> 1.3
InlineSimple.cpp updated: 1.72 -> 1.73
Internalize.cpp updated: 1.34 -> 1.35
LoopExtractor.cpp updated: 1.18 -> 1.19
LowerSetJmp.cpp updated: 1.28 -> 1.29
PruneEH.cpp updated: 1.23 -> 1.24
RaiseAllocations.cpp updated: 1.29 -> 1.30
SimplifyLibCalls.cpp updated: 1.67 -> 1.68
StripSymbols.cpp updated: 1.8 -> 1.9
---
Log message:

eliminate RegisterOpt.  It does the same thing as RegisterPass.


---
Diffs of the changes:  (+32 -28)

 ArgumentPromotion.cpp       |    4 ++--
 ConstantMerge.cpp           |    2 +-
 DeadArgumentElimination.cpp |    2 +-
 DeadTypeElimination.cpp     |    2 +-
 FunctionResolution.cpp      |    8 +++++---
 GlobalDCE.cpp               |    2 +-
 GlobalOpt.cpp               |    7 ++++---
 IPConstantPropagation.cpp   |    6 +++---
 IndMemRemoval.cpp           |    2 +-
 InlineSimple.cpp            |    2 +-
 Internalize.cpp             |    2 +-
 LoopExtractor.cpp           |    6 +++---
 LowerSetJmp.cpp             |    2 +-
 PruneEH.cpp                 |    2 +-
 RaiseAllocations.cpp        |    2 +-
 SimplifyLibCalls.cpp        |    4 ++--
 StripSymbols.cpp            |    5 +++--
 17 files changed, 32 insertions(+), 28 deletions(-)


Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.21 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.22
--- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.21	Sun Jan 22 17:32:06 2006
+++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp	Sun Aug 27 17:42:52 2006
@@ -72,8 +72,8 @@
     Function *DoPromotion(Function *F, std::vector<Argument*> &ArgsToPromote);
   };
 
-  RegisterOpt<ArgPromotion> X("argpromotion",
-                              "Promote 'by reference' arguments to scalars");
+  RegisterPass<ArgPromotion> X("argpromotion",
+                               "Promote 'by reference' arguments to scalars");
 }
 
 ModulePass *llvm::createArgumentPromotionPass() {


Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp
diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.31 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.32
--- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.31	Tue Mar  7 11:56:59 2006
+++ llvm/lib/Transforms/IPO/ConstantMerge.cpp	Sun Aug 27 17:42:52 2006
@@ -33,7 +33,7 @@
     bool runOnModule(Module &M);
   };
 
-  RegisterOpt<ConstantMerge> X("constmerge","Merge Duplicate Global Constants");
+  RegisterPass<ConstantMerge>X("constmerge","Merge Duplicate Global Constants");
 }
 
 ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); }


Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.27 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.28
--- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.27	Tue Jun 27 16:05:04 2006
+++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp	Sun Aug 27 17:42:52 2006
@@ -93,7 +93,7 @@
 
     void RemoveDeadArgumentsFromFunction(Function *F);
   };
-  RegisterOpt<DAE> X("deadargelim", "Dead Argument Elimination");
+  RegisterPass<DAE> X("deadargelim", "Dead Argument Elimination");
 
   /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but
   /// deletes arguments to functions which are external.  This is only for use


Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.55 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.56
--- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.55	Thu Apr 21 18:39:37 2005
+++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp	Sun Aug 27 17:42:52 2006
@@ -36,7 +36,7 @@
       AU.addRequired<FindUsedTypes>();
     }
   };
-  RegisterOpt<DTE> X("deadtypeelim", "Dead Type Elimination");
+  RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
   Statistic<>
   NumKilled("deadtypeelim", "Number of unused typenames removed from symtab");
 }


Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp
diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.59 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.60
--- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.59	Sun Jan 22 17:32:06 2006
+++ llvm/lib/Transforms/IPO/FunctionResolution.cpp	Sun Aug 27 17:42:52 2006
@@ -43,7 +43,7 @@
 
     bool runOnModule(Module &M);
   };
-  RegisterOpt<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
+  RegisterPass<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
 }
 
 ModulePass *llvm::createFunctionResolvingPass() {
@@ -314,7 +314,8 @@
       Globals[F->getName()].push_back(F);
   }
 
-  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) {
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+       I != E; ) {
     GlobalVariable *GV = I++;
     if (GV->use_empty() && GV->isExternal()) {
       M.getGlobalList().erase(GV);
@@ -346,7 +347,8 @@
       ++I;
     }
 
-  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; )
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+       I != E; )
     if (I->isExternal() && I->use_empty()) {
       GlobalVariable *GV = I;
       ++I;


Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp
diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.37 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.38
--- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.37	Thu Apr 21 18:39:37 2005
+++ llvm/lib/Transforms/IPO/GlobalDCE.cpp	Sun Aug 27 17:42:52 2006
@@ -44,7 +44,7 @@
     bool SafeToDestroyConstant(Constant* C);
     bool RemoveUnusedGlobalValue(GlobalValue &GV);
   };
-  RegisterOpt<GlobalDCE> X("globaldce", "Dead Global Elimination");
+  RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
 }
 
 ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.62 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.63
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.62	Fri Jul  7 16:37:01 2006
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp	Sun Aug 27 17:42:52 2006
@@ -60,10 +60,10 @@
     bool OptimizeFunctions(Module &M);
     bool OptimizeGlobalVars(Module &M);
     bool OptimizeGlobalCtorsList(GlobalVariable *&GCL);
-    bool ProcessInternalGlobal(GlobalVariable *GV, Module::global_iterator &GVI);
+    bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI);
   };
 
-  RegisterOpt<GlobalOpt> X("globalopt", "Global Variable Optimizer");
+  RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer");
 }
 
 ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); }
@@ -800,7 +800,8 @@
 // OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge
 // that only one value (besides its initializer) is ever stored to the global.
 static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
-                                     Module::global_iterator &GVI, TargetData &TD) {
+                                     Module::global_iterator &GVI,
+                                     TargetData &TD) {
   if (CastInst *CI = dyn_cast<CastInst>(StoredOnceVal))
     StoredOnceVal = CI->getOperand(0);
   else if (GetElementPtrInst *GEPI =dyn_cast<GetElementPtrInst>(StoredOnceVal)){


Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.18 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.19
--- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.18	Thu Apr 21 18:39:37 2005
+++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp	Sun Aug 27 17:42:52 2006
@@ -28,7 +28,7 @@
   Statistic<> NumArgumentsProped("ipconstprop",
                                  "Number of args turned into constants");
   Statistic<> NumReturnValProped("ipconstprop",
-                                 "Number of return values turned into constants");
+                              "Number of return values turned into constants");
 
   /// IPCP - The interprocedural constant propagation pass
   ///
@@ -38,7 +38,7 @@
     bool PropagateConstantsIntoArguments(Function &F);
     bool PropagateConstantReturn(Function &F);
   };
-  RegisterOpt<IPCP> X("ipconstprop", "Interprocedural constant propagation");
+  RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
 }
 
 ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
@@ -69,7 +69,7 @@
 /// constant in for an argument, propagate that constant in as the argument.
 ///
 bool IPCP::PropagateConstantsIntoArguments(Function &F) {
-  if (F.arg_empty() || F.use_empty()) return false;  // No arguments?  Early exit.
+  if (F.arg_empty() || F.use_empty()) return false; // No arguments? Early exit.
 
   std::vector<std::pair<Constant*, bool> > ArgumentConstants;
   ArgumentConstants.resize(F.arg_size());


Index: llvm/lib/Transforms/IPO/IndMemRemoval.cpp
diff -u llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.2 llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.3
--- llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.2	Thu Apr 13 08:43:31 2006
+++ llvm/lib/Transforms/IPO/IndMemRemoval.cpp	Sun Aug 27 17:42:52 2006
@@ -38,7 +38,7 @@
     IndMemRemPass();
     virtual bool runOnModule(Module &M);
   };
-  RegisterOpt<IndMemRemPass> X("indmemrem", "Indirect Malloc and Free Removal");
+  RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal");
 } // end anonymous namespace
 
 


Index: llvm/lib/Transforms/IPO/InlineSimple.cpp
diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.72 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.73
--- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.72	Fri Jan 13 13:35:43 2006
+++ llvm/lib/Transforms/IPO/InlineSimple.cpp	Sun Aug 27 17:42:52 2006
@@ -55,7 +55,7 @@
   public:
     int getInlineCost(CallSite CS);
   };
-  RegisterOpt<SimpleInliner> X("inline", "Function Integration/Inlining");
+  RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining");
 }
 
 ModulePass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }


Index: llvm/lib/Transforms/IPO/Internalize.cpp
diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.34 llvm/lib/Transforms/IPO/Internalize.cpp:1.35
--- llvm/lib/Transforms/IPO/Internalize.cpp:1.34	Thu Jul 20 13:03:39 2006
+++ llvm/lib/Transforms/IPO/Internalize.cpp	Sun Aug 27 17:42:52 2006
@@ -49,7 +49,7 @@
     void LoadFile(const char *Filename);
     virtual bool runOnModule(Module &M);
   };
-  RegisterOpt<InternalizePass> X("internalize", "Internalize Global Symbols");
+  RegisterPass<InternalizePass> X("internalize", "Internalize Global Symbols");
 } // end anonymous namespace
 
 InternalizePass::InternalizePass(bool InternalizeEverything) 


Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp
diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.18 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.19
--- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.18	Thu Apr 21 18:39:37 2005
+++ llvm/lib/Transforms/IPO/LoopExtractor.cpp	Sun Aug 27 17:42:52 2006
@@ -46,7 +46,7 @@
     }
   };
 
-  RegisterOpt<LoopExtractor>
+  RegisterPass<LoopExtractor>
   X("loop-extract", "Extract loops into new functions");
 
   /// SingleLoopExtractor - For bugpoint.
@@ -54,7 +54,7 @@
     SingleLoopExtractor() : LoopExtractor(1) {}
   };
 
-  RegisterOpt<SingleLoopExtractor>
+  RegisterPass<SingleLoopExtractor>
   Y("loop-extract-single", "Extract at most one loop into a new function");
 } // End anonymous namespace
 
@@ -148,7 +148,7 @@
 
     bool runOnModule(Module &M);
   };
-  RegisterOpt<BlockExtractorPass>
+  RegisterPass<BlockExtractorPass>
   XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
 }
 


Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp
diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.28 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.29
--- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.28	Sat Oct 22 23:37:20 2005
+++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp	Sun Aug 27 17:42:52 2006
@@ -120,7 +120,7 @@
     bool doInitialization(Module& M);
   };
 
-  RegisterOpt<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
+  RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
 } // end anonymous namespace
 
 // run - Run the transformation on the program. We grab the function


Index: llvm/lib/Transforms/IPO/PruneEH.cpp
diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.23 llvm/lib/Transforms/IPO/PruneEH.cpp:1.24
--- llvm/lib/Transforms/IPO/PruneEH.cpp:1.23	Wed Jul 27 01:12:34 2005
+++ llvm/lib/Transforms/IPO/PruneEH.cpp	Sun Aug 27 17:42:52 2006
@@ -46,7 +46,7 @@
     bool SimplifyFunction(Function *F);
     void DeleteBasicBlock(BasicBlock *BB);
   };
-  RegisterOpt<PruneEH> X("prune-eh", "Remove unused exception handling info");
+  RegisterPass<PruneEH> X("prune-eh", "Remove unused exception handling info");
 }
 
 ModulePass *llvm::createPruneEHPass() { return new PruneEH(); }


Index: llvm/lib/Transforms/IPO/RaiseAllocations.cpp
diff -u llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.29 llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.30
--- llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.29	Thu Apr 21 18:39:37 2005
+++ llvm/lib/Transforms/IPO/RaiseAllocations.cpp	Sun Aug 27 17:42:52 2006
@@ -44,7 +44,7 @@
     bool runOnModule(Module &M);
   };
 
-  RegisterOpt<RaiseAllocations>
+  RegisterPass<RaiseAllocations>
   X("raiseallocs", "Raise allocations from calls to instructions");
 }  // end anonymous namespace
 


Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.67 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.68
--- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.67	Fri Jun 16 13:37:15 2006
+++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp	Sun Aug 27 17:42:52 2006
@@ -366,8 +366,8 @@
 };
 
 // Register the pass
-RegisterOpt<SimplifyLibCalls>
-X("simplify-libcalls","Simplify well-known library calls");
+RegisterPass<SimplifyLibCalls>
+X("simplify-libcalls", "Simplify well-known library calls");
 
 } // anonymous namespace
 


Index: llvm/lib/Transforms/IPO/StripSymbols.cpp
diff -u llvm/lib/Transforms/IPO/StripSymbols.cpp:1.8 llvm/lib/Transforms/IPO/StripSymbols.cpp:1.9
--- llvm/lib/Transforms/IPO/StripSymbols.cpp:1.8	Thu Mar 23 12:11:33 2006
+++ llvm/lib/Transforms/IPO/StripSymbols.cpp	Sun Aug 27 17:42:52 2006
@@ -43,7 +43,7 @@
       AU.setPreservesAll();
     }
   };
-  RegisterOpt<StripSymbols> X("strip", "Strip all symbols from a module");
+  RegisterPass<StripSymbols> X("strip", "Strip all symbols from a module");
 }
 
 ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) {
@@ -75,7 +75,8 @@
   // If we're not just stripping debug info, strip all symbols from the
   // functions and the names from any internal globals.
   if (!OnlyDebugInfo) {
-    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+         I != E; ++I)
       if (I->hasInternalLinkage())
         I->setName("");     // Internal symbols can't participate in linkage
 






More information about the llvm-commits mailing list