Don't use iterator for the same reason as r226883.

llvm-svn: 226893
This commit is contained in:
Rui Ueyama 2015-01-23 01:44:51 +00:00
parent f16dbb8b07
commit 0330697bfc
1 changed files with 3 additions and 2 deletions

View File

@ -801,8 +801,9 @@ parseArgs(int argc, const char **argv, PECOFFLinkingContext &ctx,
// 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;