Index: lld/MachO/Driver.cpp =================================================================== --- lld/MachO/Driver.cpp +++ lld/MachO/Driver.cpp @@ -224,7 +224,7 @@ return CHECK(parseCachePruningPolicy(ltoPolicy), "invalid LTO cache policy"); } -static DenseMap loadedArchives; +static DenseMap loadedArchives; static InputFile *addFile(StringRef path, bool forceLoadArchive, bool isExplicit = true, bool isBundleLoader = false) { @@ -234,6 +234,7 @@ MemoryBufferRef mbref = *buffer; InputFile *newFile = nullptr; + hash_code hashedPath = hash_value(path); file_magic magic = identify_magic(mbref.getBuffer()); switch (magic) { case file_magic::archive: { @@ -243,7 +244,7 @@ // We don't take a reference to cachedFile here because the // loadArchiveMember() call below may recursively call addFile() and // invalidate this reference. - if (ArchiveFile *cachedFile = loadedArchives[path]) + if (ArchiveFile *cachedFile = loadedArchives[hashedPath]) return cachedFile; std::unique_ptr archive = CHECK( @@ -290,7 +291,7 @@ } file->addLazySymbols(); - newFile = loadedArchives[path] = file; + newFile = loadedArchives[hashedPath] = file; break; } case file_magic::macho_object: