[all-commits] [llvm/llvm-project] f66803: [clang][deps] Squash caches for original and minim...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Thu Dec 16 00:57:35 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f66803457ec7f88fa86376d9aef677dea107818c
      https://github.com/llvm/llvm-project/commit/f66803457ec7f88fa86376d9aef677dea107818c
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-12-16 (Thu, 16 Dec 2021)

  Changed paths:
    M clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
    M clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
    M clang/unittests/Tooling/DependencyScannerTest.cpp
    M llvm/include/llvm/Support/VirtualFileSystem.h
    M llvm/lib/Support/VirtualFileSystem.cpp

  Log Message:
  -----------
  [clang][deps] Squash caches for original and minimized files

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.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D115346




More information about the All-commits mailing list