[lld] r226893 - Don't use iterator for the same reason as r226883.

Rui Ueyama ruiu at google.com
Thu Jan 22 17:44:51 PST 2015


Author: ruiu
Date: Thu Jan 22 19:44:51 2015
New Revision: 226893

URL: http://llvm.org/viewvc/llvm-project?rev=226893&view=rev
Log:
Don't use iterator for the same reason as r226883.

Modified:
    lld/trunk/lib/Driver/WinLinkDriver.cpp

Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=226893&r1=226892&r2=226893&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Thu Jan 22 19:44:51 2015
@@ -801,8 +801,9 @@ parseArgs(int argc, const char **argv, P
 // graph.
 static bool hasLibrary(PECOFFLinkingContext &ctx, File *file) {
   StringRef path = file->path();
-  for (std::unique_ptr<Node> &p : ctx.getNodes())
-    if (auto *f = dyn_cast<FileNode>(p.get()))
+  std::vector<std::unique_ptr<Node>> &nodes = ctx.getNodes();
+  for (size_t i = 0; i < nodes.size(); ++i)
+    if (auto *f = dyn_cast<FileNode>(nodes[i].get()))
       if (f->getFile()->path() == path)
         return true;
   return false;





More information about the llvm-commits mailing list