[PATCH] D115346: [clang][deps] Squash caches for original and minimized files
    Jan Svoboda via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Dec  9 07:33:15 PST 2021
    
    
  
jansvoboda11 added a comment.
In D115346#3181198 <https://reviews.llvm.org/D115346#3181198>, @dexonsmith wrote:
> This looks really nice.
>
> One problem is that it's subtle to confirm whether it's thread-safe. The local cache access parts of CachedFileSystemEntry lock-free, but the CachedFileSystemEntry might get changed later (i.e., filled in with minimized content). Are accessed fields guaranteed by context not to be the ones that mutate later?
I believe the latest revision is thread-safe (albeit with benign data-races on `needsMinimization`). Once a `CachedFileSystemEntry` has been created, only the `MinimizedContents` and `PPSkippedRangeMapping` members can be modified (at most once, under a lock). Access to those fields only happens in "minimizing" contexts.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115346/new/
https://reviews.llvm.org/D115346
    
    
More information about the llvm-commits
mailing list