summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/Caching.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Try using llvm::errc, should hopefully fix version mismatch problem on ↵Peter Collingbourne2017-03-201-4/+2
| | | | | | clang-s390x-linux bot. llvm-svn: 298285
* Support, LTO: When pruning a directory, ignore files matching a prefix.Peter Collingbourne2017-03-201-2/+4
| | | | | | | | | | This is a safeguard against data loss if the user specifies a directory that is not a cache directory. Teach the existing cache pruning clients to create files with appropriate names. Differential Revision: https://reviews.llvm.org/D31109 llvm-svn: 298271
* LTO: Work around libstdc++ version mismatch bug, see D31063 review thread.Peter Collingbourne2017-03-171-1/+4
| | | | llvm-svn: 298127
* LTO: Fix a potential race condition in the caching API.Peter Collingbourne2017-03-171-9/+24
| | | | | | | | | | | | | | | | | | | | | After the call to sys::fs::exists succeeds, indicating a cache hit, we call AddFile and the client will open the file using the supplied path. If the client is using cache pruning, there is a potential race between the pruner and the client. To avoid this, change the caching API so that it provides a MemoryBuffer to the client, and have clients use that MemoryBuffer where possible. This scheme won't work with the gold plugin because the plugin API expects a file path. So we have the gold plugin use the buffer identifier as a path and live with the race for now. (Note that the gold plugin isn't actually affected by the problem at the moment because it doesn't support cache pruning.) This effectively reverts r279883 modulo the change to use the existing path in the gold plugin. Differential Revision: https://reviews.llvm.org/D31063 llvm-svn: 298020
* LTO: Create temporary cache files in the cache directory instead of $TMPDIR.Peter Collingbourne2017-03-161-28/+8
| | | | | | | | | | This fixes a race condition where another linker process can observe a partially written file if we copy it from another file system, and allows the link to be independent of the amount of free disk space in $TMPDIR. Differential Revision: https://reviews.llvm.org/D31045 llvm-svn: 297970
* LTO: When creating a local cache, create the cache directory if it does not ↵Peter Collingbourne2017-03-021-2/+5
| | | | | | | | already exist. Differential Revision: https://reviews.llvm.org/D30519 llvm-svn: 296726
* Apply clang-tidy's performance-unnecessary-value-param to LLVM.Benjamin Kramer2017-01-131-3/+4
| | | | | | | With some minor manual fixes for using function_ref instead of std::function. No functional change intended. llvm-svn: 291904
* Add qualification to fix MSVC build.Peter Collingbourne2016-09-231-1/+1
| | | | llvm-svn: 282313
* LTO: Simplify caching interface.Peter Collingbourne2016-09-231-50/+51
| | | | | | | | | | | | | | | | | The NativeObjectOutput class has a design problem: it mixes up the caching policy with the interface for output streams, which makes the client-side code hard to follow and would for example make it harder to replace the cache implementation in an arbitrary client. This change separates the two aspects by moving the caching policy to a separate field in Config, replacing NativeObjectOutput with a NativeObjectStream class which only deals with streams and does not need to be overridden by most clients and introducing an AddFile callback for adding files (e.g. from the cache) to the link. Differential Revision: https://reviews.llvm.org/D24622 llvm-svn: 282299
* [ThinLTO] Move loading of cache entry to clientTeresa Johnson2016-08-261-8/+2
| | | | | | | | | | | | | | | | | | | | | | 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
* [ThinLTO] Add caching to the new LTO APIMehdi Amini2016-08-231-0/+104
Add the ability to plug a cache on the LTO API. I tried to write such that a linker implementation can control the cache backend. This is intrusive and I'm not totally happy with it, but I can't figure out a better design right now. Differential Revision: https://reviews.llvm.org/D23599 llvm-svn: 279576
OpenPOWER on IntegriCloud