[clang] 94d22b0 - [clang][deps] Do not cache PCM files

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 17:44:01 PDT 2023


Author: Jan Svoboda
Date: 2023-05-15T17:43:54-07:00
New Revision: 94d22b09bbb212773a226726ee03a44edbbe98c7

URL: https://github.com/llvm/llvm-project/commit/94d22b09bbb212773a226726ee03a44edbbe98c7
DIFF: https://github.com/llvm/llvm-project/commit/94d22b09bbb212773a226726ee03a44edbbe98c7.diff

LOG: [clang][deps] Do not cache PCM files

On incremental scan, caching an out-of-date PCM on the VFS layer causes each TU and each module to recompile the PCM again. This is huge performance problem. Stop caching ".pcm" files.

Reviewed By: Bigcheese

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

Added: 
    

Modified: 
    clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
index 0ddb5c24c5e6..31404855e3b1 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
@@ -262,6 +262,9 @@ DependencyScanningWorkerFilesystem::status(const Twine &Path) {
   SmallString<256> OwnedFilename;
   StringRef Filename = Path.toStringRef(OwnedFilename);
 
+  if (Filename.endswith(".pcm"))
+    return getUnderlyingFS().status(Path);
+
   llvm::ErrorOr<EntryRef> Result = getOrCreateFileSystemEntry(Filename);
   if (!Result)
     return Result.getError();
@@ -319,6 +322,9 @@ DependencyScanningWorkerFilesystem::openFileForRead(const Twine &Path) {
   SmallString<256> OwnedFilename;
   StringRef Filename = Path.toStringRef(OwnedFilename);
 
+  if (Filename.endswith(".pcm"))
+    return getUnderlyingFS().openFileForRead(Path);
+
   llvm::ErrorOr<EntryRef> Result = getOrCreateFileSystemEntry(Filename);
   if (!Result)
     return Result.getError();


        


More information about the cfe-commits mailing list