diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -1100,6 +1100,7 @@ resolvedFrameworks.clear(); resolvedLibraries.clear(); + resolvedReads.clear(); concatOutputSections.clear(); inputFiles.clear(); inputSections.clear(); diff --git a/lld/MachO/InputFiles.h b/lld/MachO/InputFiles.h --- a/lld/MachO/InputFiles.h +++ b/lld/MachO/InputFiles.h @@ -14,6 +14,7 @@ #include "lld/Common/LLVM.h" #include "lld/Common/Memory.h" +#include "llvm/ADT/CachedHashString.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/SetVector.h" #include "llvm/BinaryFormat/MachO.h" @@ -211,6 +212,7 @@ }; extern llvm::SetVector inputFiles; +extern llvm::DenseMap resolvedReads; llvm::Optional readFile(StringRef path); diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp --- a/lld/MachO/InputFiles.cpp +++ b/lld/MachO/InputFiles.cpp @@ -178,7 +178,7 @@ // level, and other files like the filelist that are only read once. // Theoretically this caching could be more efficient by hoisting it, but that // would require altering many callers to track the state. -static DenseMap resolvedReads; +DenseMap macho::resolvedReads; // Open a given file path and return it as a memory-mapped file. Optional macho::readFile(StringRef path) { CachedHashStringRef key(path);