From 26a462877b325db106e3a08cdd0dbda5533913a5 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Fri, 26 Aug 2016 23:29:14 +0000 Subject: [ThinLTO] Move loading of cache entry to client Summary: Have the cache pass back the path to the cache entry when it is ready to be loaded, instead of a buffer. For gold-plugin we can simply pass this file back to gold directly, which avoids expensive writing of a separate tmp file. Ensure the cache entry is not deleted on cleanup by adjusting the setting of the IsTemporary flags. Moved the loading of the buffer into llvm-lto2 to maintain current behavior. Reviewers: mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23946 llvm-svn: 279883 --- llvm/lib/LTO/Caching.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'llvm/lib/LTO/Caching.cpp') diff --git a/llvm/lib/LTO/Caching.cpp b/llvm/lib/LTO/Caching.cpp index 118efde6a1f..728e5164dfa 100644 --- a/llvm/lib/LTO/Caching.cpp +++ b/llvm/lib/LTO/Caching.cpp @@ -64,14 +64,8 @@ CacheObjectOutput::~CacheObjectOutput() { // We commit the tempfile into the cache now, by moving it to EntryPath. commitEntry(TempFilename, EntryPath); } - // Load the entry from the cache now. - auto ReloadedBufferOrErr = MemoryBuffer::getFile(EntryPath); - if (auto EC = ReloadedBufferOrErr.getError()) - report_fatal_error(Twine("Can't reload cached file '") + EntryPath + "': " + - EC.message() + "\n"); - - // Supply the resulting buffer to the user. - AddBuffer(std::move(*ReloadedBufferOrErr)); + // Supply the cache path to the user. + AddBuffer(EntryPath.str()); } // Return an allocated stream for the output, or null in case of failure. -- cgit v1.2.3