diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-08-26 23:29:14 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-08-26 23:29:14 +0000 |
commit | 26a462877b325db106e3a08cdd0dbda5533913a5 (patch) | |
tree | 8f50e4e38adb21d45bb1516b80fa07c3488f3047 /llvm/lib/LTO/Caching.cpp | |
parent | ac9c3a62a1e76df587fb14eb83be2229157962b1 (diff) | |
download | bcm5719-llvm-26a462877b325db106e3a08cdd0dbda5533913a5.tar.gz bcm5719-llvm-26a462877b325db106e3a08cdd0dbda5533913a5.zip |
[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
Diffstat (limited to 'llvm/lib/LTO/Caching.cpp')
-rw-r--r-- | llvm/lib/LTO/Caching.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
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. |