[PATCH] D145526: [clang][DependencyScanner] Cache modulemap stat failures
Michael Spencer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 7 14:56:11 PST 2023
Bigcheese updated this revision to Diff 503160.
Bigcheese added a comment.
Forgot that `Filename` is actually a path, so call `llvm::sys::path::filename`.
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,10 @@
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.
+ if (llvm::sys::path::filename(Filename) == "module.modulemap")
+ return true;
return shouldScanForDirectivesBasedOnExtension(Filename);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145526.503160.patch
Type: text/x-patch
Size: 747 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230307/4d256eaf/attachment.bin>
More information about the cfe-commits
mailing list