summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp')
-rw-r--r--gnu/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/gnu/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp b/gnu/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp
index 799df1d3c3a..f5856cb6542 100644
--- a/gnu/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp
+++ b/gnu/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp
@@ -1,4 +1,4 @@
-//===--- FileSystemStatCache.cpp - Caching for 'stat' calls ---------------===//
+//===- FileSystemStatCache.cpp - Caching for 'stat' calls -----------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -13,11 +13,14 @@
#include "clang/Basic/FileSystemStatCache.h"
#include "clang/Basic/VirtualFileSystem.h"
+#include "llvm/Support/Chrono.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/Path.h"
+#include <utility>
using namespace clang;
-void FileSystemStatCache::anchor() { }
+void FileSystemStatCache::anchor() {}
static void copyStatusToFileData(const vfs::Status &Status,
FileData &Data) {
@@ -92,17 +95,17 @@ bool FileSystemStatCache::get(StringRef Path, FileData &Data, bool isFile,
// If the path doesn't exist, return failure.
if (R == CacheMissing) return true;
-
+
// If the path exists, make sure that its "directoryness" matches the clients
// demands.
if (Data.IsDirectory != isForDir) {
// If not, close the file if opened.
if (F)
*F = nullptr;
-
+
return true;
}
-
+
return false;
}
@@ -117,7 +120,7 @@ MemorizeStatCalls::getStat(StringRef Path, FileData &Data, bool isFile,
// entries).
if (Result == CacheMissing)
return Result;
-
+
// Cache file 'stat' results and directories with absolutely paths.
if (!Data.IsDirectory || llvm::sys::path::is_absolute(Path))
StatCalls[Path] = Data;