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

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



Changes in directory llvm/tools/llvm-ld:

llvm-ld.cpp updated: 1.8 -> 1.9
---
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:  (+1 -3)

Index: llvm/tools/llvm-ld/llvm-ld.cpp
diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.8 llvm/tools/llvm-ld/llvm-ld.cpp:1.9
--- llvm/tools/llvm-ld/llvm-ld.cpp:1.8	Sun Dec 12 21:01:14 2004
+++ llvm/tools/llvm-ld/llvm-ld.cpp	Mon Dec 13 11:18:19 2004
@@ -390,7 +390,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
@@ -406,8 +406,6 @@
     } 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
     }
   }
 }






More information about the llvm-commits mailing list