summaryrefslogtreecommitdiffstats
path: root/lld/COFF/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/InputFiles.cpp')
-rw-r--r--lld/COFF/InputFiles.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 66d792ba4cf..be5c0ed721c 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -71,12 +71,6 @@ std::error_code ArchiveFile::parse() {
if (B->getName() != "__NULL_IMPORT_DESCRIPTOR")
LazySymbols.push_back(B);
}
-
- // Seen is a map from member files to boolean values. Initially
- // all members are mapped to false, which indicates all these files
- // are not read yet.
- for (const Archive::Child &Child : File->children())
- Seen[Child.getBuffer().data()].clear();
return std::error_code();
}
@@ -90,7 +84,8 @@ ErrorOr<MemoryBufferRef> ArchiveFile::getMember(const Archive::Symbol *Sym) {
// Return an empty buffer if we have already returned the same buffer.
const char *StartAddr = It->getBuffer().data();
- if (Seen[StartAddr].test_and_set())
+ auto Pair = Seen.insert(StartAddr);
+ if (!Pair.second)
return MemoryBufferRef();
return It->getMemoryBufferRef();
}
OpenPOWER on IntegriCloud