diff options
Diffstat (limited to 'llvm/tools/gold/gold-plugin.cpp')
-rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 123d90df890..38674d20717 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -831,11 +831,15 @@ static ld_plugin_status allSymbolsReadHook() { llvm::make_unique<llvm::raw_fd_ostream>(FD, true)); }; - auto AddFile = [&](size_t Task, StringRef Path) { Filenames[Task] = Path; }; + auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB) { + // Note that this requires that the memory buffers provided to AddBuffer are + // backed by a file. + Filenames[Task] = MB->getBufferIdentifier(); + }; NativeObjectCache Cache; if (!options::cache_dir.empty()) - Cache = check(localCache(options::cache_dir, AddFile)); + Cache = check(localCache(options::cache_dir, AddBuffer)); check(Lto->run(AddStream, Cache)); |