summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKousik Kumar <kousikk@google.com>2019-10-10 15:29:01 +0000
committerKousik Kumar <kousikk@google.com>2019-10-10 15:29:01 +0000
commitd4eeec7cfe1aea662f4f75bef90de475ade856ca (patch)
tree61d7220514aa8e537bf7525d7b4d540fe0538c07 /include
parent20b3d56a1f44ea1972f39422f21dcc1e2d6f9f87 (diff)
downloadclang-d4eeec7cfe1aea662f4f75bef90de475ade856ca.tar.gz
In openFileForRead don't cache erroneous entries if the error relates to them being directories. Add tests.
Summary: It seems that when the CachingFileSystem is first given a file to open that is actually a directory, it incorrectly caches that path to be errenous and throws an error when subsequently a directory open call is made for the same path. This change makes it so that we do NOT cache a path if it turns out we asked for a file when its a directory. Reviewers: arphaman Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68193 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h b/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
index 1d0d26589e..7d08813434 100644
--- a/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
+++ b/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
@@ -168,6 +168,9 @@ private:
return It == Cache.end() ? nullptr : It->getValue();
}
+ llvm::ErrorOr<const CachedFileSystemEntry *>
+ getOrCreateFileSystemEntry(const StringRef Filename);
+
DependencyScanningFilesystemSharedCache &SharedCache;
/// The local cache is used by the worker thread to cache file system queries
/// locally instead of querying the global cache every time.