summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/Caching.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/LTO/Caching.cpp')
-rw-r--r--llvm/lib/LTO/Caching.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/LTO/Caching.cpp b/llvm/lib/LTO/Caching.cpp
index f635369df8d..fc898c49998 100644
--- a/llvm/lib/LTO/Caching.cpp
+++ b/llvm/lib/LTO/Caching.cpp
@@ -46,8 +46,11 @@ static void commitEntry(StringRef TempFilename, StringRef EntryPath) {
}
}
-NativeObjectCache lto::localCache(StringRef CacheDirectoryPath,
- AddFileFn AddFile) {
+Expected<NativeObjectCache> lto::localCache(StringRef CacheDirectoryPath,
+ AddFileFn AddFile) {
+ if (std::error_code EC = sys::fs::create_directories(CacheDirectoryPath))
+ return errorCodeToError(EC);
+
return [=](unsigned Task, StringRef Key) -> AddStreamFn {
// First, see if we have a cache hit.
SmallString<64> EntryPath;
OpenPOWER on IntegriCloud