[PATCH] D115346: [clang][deps] Squash caches for original and minimized files

Jan Svoboda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 07:09:31 PST 2021


jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, dexonsmith, arphaman.
Herald added a subscriber: hiraditya.
jansvoboda11 requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

The minimizing and caching filesystem used by the dependency scanner keeps minimized and original files in separate caches.

This setup is not well suited for dealing with files that are sometimes minimized and sometimes not. Such files are being stat-ed and read twice, which is wasteful and also means the two versions of the file can get "out of sync".

This patch squashes the two caches together. When a file is stat-ed or read, its original contents are populated. If a file needs to be minimized, we give the minimizer the already loaded contents instead of reading the file again.

Depends on D115043 <https://reviews.llvm.org/D115043>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115346

Files:
  clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
  clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
  llvm/include/llvm/Support/VirtualFileSystem.h
  llvm/lib/Support/VirtualFileSystem.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115346.392759.patch
Type: text/x-patch
Size: 16772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211208/c7a1554b/attachment.bin>


More information about the llvm-commits mailing list