llvm-project/clang/unittests
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
..
AST [AST] Fix the incorrect auto-keyword loc for constrained auto type loc. 2022-01-19 14:18:38 +01:00
ASTMatchers Add `isConsteval` matcher 2022-01-20 13:35:10 -05:00
Analysis [clang][dataflow] Intersect ExprToLoc when joining environments 2022-01-20 14:30:17 +00:00
Basic [Clang] Extract availability mapping from VersionMap for watchOS/tvOS 2022-01-05 17:00:03 -08:00
CodeGen [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00
CrossTU Revert "[analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file" 2021-12-16 20:46:51 -05:00
DirectoryWatcher Revert "Re-Revert "DirectoryWatcher: add an implementation for Windows"" 2021-06-19 09:19:52 -07:00
Driver [clang] Fix a misadjusted path style comparison in a unittest 2021-12-09 11:47:43 +02:00
Format [clang-format] Indicate source location on test failure. NFC. 2022-01-20 14:10:59 +01:00
Frontend [llvm] Add null-termination capability to SmallVectorMemoryBuffer 2021-12-09 11:32:13 +01:00
Index [clang] Visit enum base specifiers in libIndex 2021-10-25 13:16:14 +02:00
Interpreter [clang-repl][NFC] Fix calling convention mismatch in test 2021-11-30 13:26:10 -08:00
Introspection [AST] Fix DeclarationNameInfo introspection 2021-04-26 18:49:13 +01:00
Lex [clang][lex] NFC: Simplify calls to `LookupFile` 2022-01-18 16:02:18 +01:00
Rename Bump googletest to 1.10.0 2021-05-14 19:16:31 +02:00
Rewrite
Sema [NFC][Clang][test] Inclusive language: Remove and rephrase uses of sanity test/check in clang/test 2021-11-24 14:03:49 -05:00
Serialization [Frontend] Only compile modules if not already finalized 2021-07-15 18:27:08 -07:00
StaticAnalyzer [analyzer][NFC] Re-enable skipped SValTests by relaxing expectations 2022-01-19 15:16:18 +01:00
Tooling [clang][deps] Ensure filesystem cache consistency 2022-01-21 13:04:25 +01:00
libclang [libclang] Add CXRewriter to libclang API 2020-09-04 14:17:03 -07:00
CMakeLists.txt [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00