[PATCH] D113198: [lld-macho] Clear resolvedReads cachehttps://reviews.llvm.org/D113153 #3108083
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 4 09:43:43 PDT 2021
keith created this revision.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
keith requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
smeenai, int3
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113198
Files:
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
Index: lld/MachO/InputFiles.h
===================================================================
--- lld/MachO/InputFiles.h
+++ 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<InputFile *> inputFiles;
+extern llvm::DenseMap<llvm::CachedHashStringRef, MemoryBufferRef> resolvedReads;
llvm::Optional<MemoryBufferRef> readFile(StringRef path);
Index: lld/MachO/InputFiles.cpp
===================================================================
--- lld/MachO/InputFiles.cpp
+++ 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<CachedHashStringRef, MemoryBufferRef> resolvedReads;
+DenseMap<CachedHashStringRef, MemoryBufferRef> macho::resolvedReads;
// Open a given file path and return it as a memory-mapped file.
Optional<MemoryBufferRef> macho::readFile(StringRef path) {
CachedHashStringRef key(path);
Index: lld/MachO/Driver.cpp
===================================================================
--- lld/MachO/Driver.cpp
+++ lld/MachO/Driver.cpp
@@ -1100,6 +1100,7 @@
resolvedFrameworks.clear();
resolvedLibraries.clear();
+ resolvedReads.clear();
concatOutputSections.clear();
inputFiles.clear();
inputSections.clear();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113198.384786.patch
Type: text/x-patch
Size: 1637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/50380eb4/attachment-0001.bin>
More information about the llvm-commits
mailing list