[llvm-commits] [llvm] r47334 - /llvm/trunk/lib/Linker/LinkModules.cpp

Chris Lattner sabre at nondot.org
Tue Feb 19 10:49:09 PST 2008


Author: lattner
Date: Tue Feb 19 12:49:08 2008
New Revision: 47334

URL: http://llvm.org/viewvc/llvm-project?rev=47334&view=rev
Log:
random cleanups.

Modified:
    llvm/trunk/lib/Linker/LinkModules.cpp

Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=47334&r1=47333&r2=47334&view=diff

==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Tue Feb 19 12:49:08 2008
@@ -965,7 +965,7 @@
     }
   }
 
-  // COpy the target triple from the source to dest if the dest's is empty
+  // Copy the target triple from the source to dest if the dest's is empty.
   if (Dest->getTargetTriple().empty() && !Src->getTargetTriple().empty())
     Dest->setTargetTriple(Src->getTargetTriple());
       
@@ -976,7 +976,7 @@
       Dest->getTargetTriple() != Src->getTargetTriple())
     cerr << "WARNING: Linking two modules of different target triples!\n";
 
-  // Append the module inline asm string
+  // Append the module inline asm string.
   if (!Src->getModuleInlineAsm().empty()) {
     if (Dest->getModuleInlineAsm().empty())
       Dest->setModuleInlineAsm(Src->getModuleInlineAsm());
@@ -988,12 +988,9 @@
   // Update the destination module's dependent libraries list with the libraries
   // from the source module. There's no opportunity for duplicates here as the
   // Module ensures that duplicate insertions are discarded.
-  Module::lib_iterator SI = Src->lib_begin();
-  Module::lib_iterator SE = Src->lib_end();
-  while ( SI != SE ) {
+  for (Module::lib_iterator SI = Src->lib_begin(), SE = Src->lib_end();
+       SI != SE; ++SI) 
     Dest->addLibrary(*SI);
-    ++SI;
-  }
 
   // LinkTypes - Go through the symbol table of the Src module and see if any
   // types are named in the src module that are not named in the Dst module.





More information about the llvm-commits mailing list