[lld] r296726 - LTO: When creating a local cache, create the cache directory if it does not already exist.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 1 18:02:39 PST 2017
Author: pcc
Date: Wed Mar 1 20:02:38 2017
New Revision: 296726
URL: http://llvm.org/viewvc/llvm-project?rev=296726&view=rev
Log:
LTO: When creating a local cache, create the cache directory if it does not already exist.
Differential Revision: https://reviews.llvm.org/D30519
Modified:
lld/trunk/ELF/LTO.cpp
lld/trunk/test/ELF/lto/cache.ll
Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=296726&r1=296725&r2=296726&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Wed Mar 1 20:02:38 2017
@@ -150,10 +150,10 @@ std::vector<InputFile *> BitcodeCompiler
// specified, configure LTO to use it as the cache directory.
lto::NativeObjectCache Cache;
if (!Config->ThinLTOCacheDir.empty())
- Cache = lto::localCache(Config->ThinLTOCacheDir,
- [&](size_t Task, StringRef Path) {
- Files[Task] = check(MemoryBuffer::getFile(Path));
- });
+ Cache = check(lto::localCache(
+ Config->ThinLTOCacheDir, [&](size_t Task, StringRef Path) {
+ Files[Task] = check(MemoryBuffer::getFile(Path));
+ }));
checkError(LTOObj->run(
[&](size_t Task) {
Modified: lld/trunk/test/ELF/lto/cache.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/cache.ll?rev=296726&r1=296725&r2=296726&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/cache.ll (original)
+++ lld/trunk/test/ELF/lto/cache.ll Wed Mar 1 20:02:38 2017
@@ -3,7 +3,7 @@
; RUN: opt -module-hash -module-summary %s -o %t.o
; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o
-; RUN: rm -Rf %t.cache && mkdir %t.cache
+; RUN: rm -Rf %t.cache
; RUN: ld.lld --thinlto-cache-dir=%t.cache -o %t3.o %t2.o %t.o
; RUN: ls %t.cache | count 2
More information about the llvm-commits
mailing list