[llvm-commits] CVS: llvm/lib/Linker/LinkArchives.cpp LinkModules.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 14 20:55:02 PST 2005



Changes in directory llvm/lib/Linker:

LinkArchives.cpp updated: 1.46 -> 1.47
LinkModules.cpp updated: 1.103 -> 1.104
---
Log message:

This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!



---
Diffs of the changes:  (+8 -8)

 LinkArchives.cpp |    4 ++--
 LinkModules.cpp  |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)


Index: llvm/lib/Linker/LinkArchives.cpp
diff -u llvm/lib/Linker/LinkArchives.cpp:1.46 llvm/lib/Linker/LinkArchives.cpp:1.47
--- llvm/lib/Linker/LinkArchives.cpp:1.46	Sun Feb 13 11:50:16 2005
+++ llvm/lib/Linker/LinkArchives.cpp	Mon Mar 14 22:54:19 2005
@@ -33,7 +33,7 @@
   for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
     if (I->hasName() && !I->isExternal() && !I->hasInternalLinkage())
       DefinedSymbols.insert(I->getName());
-  for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
+  for (Module::global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
     if (I->hasName() && !I->isExternal() && !I->hasInternalLinkage())
       DefinedSymbols.insert(I->getName());
 }
@@ -62,7 +62,7 @@
       else if (!I->hasInternalLinkage())
         DefinedSymbols.insert(I->getName());
     }
-  for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
+  for (Module::global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
     if (I->hasName()) {
       if (I->isExternal())
         UndefinedSymbols.insert(I->getName());


Index: llvm/lib/Linker/LinkModules.cpp
diff -u llvm/lib/Linker/LinkModules.cpp:1.103 llvm/lib/Linker/LinkModules.cpp:1.104
--- llvm/lib/Linker/LinkModules.cpp:1.103	Sat Feb 19 11:52:37 2005
+++ llvm/lib/Linker/LinkModules.cpp	Mon Mar 14 22:54:19 2005
@@ -425,7 +425,7 @@
   SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable();
   
   // Loop over all of the globals in the src module, mapping them over as we go
-  for (Module::giterator I = Src->gbegin(), E = Src->gend(); I != E; ++I) {
+  for (Module::global_iterator I = Src->global_begin(), E = Src->global_end(); I != E; ++I) {
     GlobalVariable *SGV = I;
     GlobalVariable *DGV = 0;
     // Check to see if may have to link the global.
@@ -533,7 +533,7 @@
                             std::string *Err) {
 
   // Loop over all of the globals in the src module, mapping them over as we go
-  for (Module::const_giterator I = Src->gbegin(), E = Src->gend(); I != E; ++I){
+  for (Module::const_global_iterator I = Src->global_begin(), E = Src->global_end(); I != E; ++I){
     const GlobalVariable *SGV = I;
 
     if (SGV->hasInitializer()) {      // Only process initialized GV's
@@ -656,8 +656,8 @@
   assert(Src && Dest && Dest->isExternal() && !Src->isExternal());
 
   // Go through and convert function arguments over, remembering the mapping.
-  Function::aiterator DI = Dest->abegin();
-  for (Function::aiterator I = Src->abegin(), E = Src->aend();
+  Function::arg_iterator DI = Dest->arg_begin();
+  for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end();
        I != E; ++I, ++DI) {
     DI->setName(I->getName());  // Copy the name information over...
 
@@ -681,7 +681,7 @@
           *OI = RemapOperand(*OI, GlobalMap);
 
   // There is no need to map the arguments anymore.
-  for (Function::aiterator I = Src->abegin(), E = Src->aend(); I != E; ++I)
+  for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end(); I != E; ++I)
     GlobalMap.erase(I);
 
   return false;
@@ -854,7 +854,7 @@
   // it's functionality here.
   std::map<std::string, GlobalValue*> GlobalsByName;
 
-  for (Module::giterator I = Dest->gbegin(), E = Dest->gend(); I != E; ++I) {
+  for (Module::global_iterator I = Dest->global_begin(), E = Dest->global_end(); I != E; ++I) {
     // Add all of the appending globals already in the Dest module to
     // AppendingVars.
     if (I->hasAppendingLinkage())






More information about the llvm-commits mailing list