llvm-project/clang/unittests/Tooling
Jan Svoboda 5daeada330 [clang][deps] Ensure filesystem cache consistency
The minimizing filesystem used by the dependency scanner isn't great when it comes to the consistency of its caches. There are two problems that can be exposed by a filesystem that changes during dependency scan:
1. In-memory cache entries for original and minimized files are distinct, populated at different times using separate stat/open syscalls. This means that when a file is read with minimization disabled, its contents might be inconsistent when the same file is read with minimization enabled at later point (and vice versa).
2. In-memory cache entries are indexed by filename. This is problematic for symlinks, where the contents of the symlink might be inconsistent with contents of the original file (for the same reason as in problem 1).

This patch ensures consistency by always stating/reading a file exactly once. The original contents are always cached and minimized contents are derived from that on demand. The cache entries are now indexed by their `UniqueID` ensuring consistency for symlinks too. Moreover, the stat/read syscalls are now issued outside of critical section.

Depends on D115935.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D114966
2022-01-21 13:04:25 +01:00
..
RecursiveASTVisitorTests [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
Syntax [NFC][testing] Return underlying strings directly instead of OS.str() 2021-12-09 16:05:46 -08:00
ASTSelectionTest.cpp Use std::foo_t rather than std::foo in clang. 2020-02-11 10:37:08 -08:00
CMakeLists.txt Fix TargetRegistry shlib build, clang edition 2021-10-08 15:43:56 -07:00
CastExprTest.cpp Adapt CastExpr::getSubExprAsWritten to ConstantExpr 2021-01-12 09:41:03 +01:00
CommentHandlerTest.cpp
CompilationDatabaseTest.cpp [Tooling] When transferring compile commands between files, always use '--' 2022-01-11 01:41:42 +01:00
DependencyScannerTest.cpp [clang][deps] Ensure filesystem cache consistency 2022-01-21 13:04:25 +01:00
DiagnosticsYamlTest.cpp Remark was added to clang tooling Diagnostic 2021-05-24 11:21:44 -04:00
ExecutionTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
FixItTest.cpp
HeaderIncludesTest.cpp [Tooling][Format] Treat compound extensions (foo.bar.cc) as matching foo.h 2020-08-27 15:24:17 +02:00
LexicallyOrderedRecursiveASTVisitorTest.cpp
LookupTest.cpp Move clang/Tooling/Core/Lookup.h to clang/Tooling/Refactoring/Lookup.h 2020-10-20 10:13:28 +01:00
QualTypeNamesTest.cpp [AST] Add more testcases to QualTypeNamesTest. NFC 2021-12-15 21:59:54 +01:00
RangeSelectorTest.cpp Widen `name` stencil to support `TypeLoc` nodes. 2021-05-13 23:23:12 +01:00
RecursiveASTVisitorTestDeclVisitor.cpp
RecursiveASTVisitorTestPostOrderVisitor.cpp [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
RecursiveASTVisitorTestTypeLocVisitor.cpp
RefactoringActionRulesTest.cpp
RefactoringCallbacksTest.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
RefactoringTest.cpp Support: Use sys::path::is_style_{posix,windows}() in a few places 2021-10-29 12:09:41 -07:00
ReplacementTest.h
ReplacementsYamlTest.cpp [yaml][clang-tidy] Fix multiline YAML serialization 2020-07-09 02:41:58 -07:00
RewriterTest.cpp
RewriterTestContext.h Tooling: Migrate some tests to FileEntryRef, NFC 2020-12-10 18:05:03 -08:00
SourceCodeBuildersTest.cpp [libTooling] Add support for implicit `this` to `buildAddressOf`. 2021-07-07 17:35:04 +00:00
SourceCodeTest.cpp [clang][AST] Handle overload callee type in CallExpr::getCallReturnType. 2021-04-12 09:44:17 +02:00
StencilTest.cpp [libTooling] Add "switch"-like Stencil combinator 2021-10-14 16:45:37 +00:00
TestVisitor.h
ToolingTest.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
TransformerTest.cpp [libTooling] Remove deprecated Clang Transformer declarations 2020-11-30 20:15:26 +00:00