[llvm-commits] CVS: llvm/tools/gccld/gccld.cpp

Reid Spencer reid at x10sys.com
Mon Dec 13 09:18:30 PST 2004



Changes in directory llvm/tools/gccld:

gccld.cpp updated: 1.86 -> 1.87
---
Log message:

Make the loop termination condition clear when building the set of items to
pass to the Linker::LinkInItems function.


---
Diffs of the changes:  (+2 -3)

Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.86 llvm/tools/gccld/gccld.cpp:1.87
--- llvm/tools/gccld/gccld.cpp:1.86	Sun Dec 12 21:01:14 2004
+++ llvm/tools/gccld/gccld.cpp	Mon Dec 13 11:18:19 2004
@@ -173,7 +173,7 @@
   cl::list<std::string>::const_iterator libIt  = Libraries.begin();
 
   int libPos = -1, filePos = -1;
-  while ( 1 ) {
+  while ( libIt != Libraries.end() || fileIt != Files.end() ) {
     if (libIt != Libraries.end())
       libPos = Libraries.getPosition(libIt - Libraries.begin());
     else
@@ -189,11 +189,10 @@
     } else if (libPos != -1 && (filePos == -1 || libPos < filePos)) {
       // Add a library
       Items.push_back(std::make_pair(*libIt++, true));
-    } else {
-        break; // we're done with the list
     }
   }
 }
+
 int main(int argc, char **argv, char **envp) {
   cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
   sys::PrintStackTraceOnErrorSignal();






More information about the llvm-commits mailing list