[PATCH] D145526: [clang][DependencyScanner] Cache modulemap stat failures

Michael Spencer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 7 15:14:40 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG57c7750f703d: [clang][DependencyScanner] Cache modulemap stat failures (authored by Bigcheese).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145526/new/

https://reviews.llvm.org/D145526

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


Index: clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
===================================================================
--- clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
+++ clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
@@ -181,7 +181,11 @@
   StringRef Ext = llvm::sys::path::extension(Filename);
   if (Ext.empty())
     return false; // This may be the module cache directory.
-  // Only cache stat failures on source files.
+  // Only cache stat failures on files that are not expected to change during
+  // the build.
+  StringRef FName = llvm::sys::path::filename(Filename);
+  if (FName == "module.modulemap" || FName == "module.map")
+    return true;
   return shouldScanForDirectivesBasedOnExtension(Filename);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145526.503165.patch
Type: text/x-patch
Size: 800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230307/e2cd42b4/attachment-0001.bin>


More information about the cfe-commits mailing list