Bigcheese created this revision. Bigcheese added reviewers: ributzka, benlangmuir, jansvoboda11. Bigcheese added a project: clang. Herald added a project: All. Bigcheese requested review of this revision. Herald added a subscriber: cfe-commits.
Add `module.modulemap` as a file we cache stat failures for as there are a lot of stats for this file. Clang currently uses the files it should minimize as a proxy for files it should cache stat failures for, but really we should cache stat failures for all paths we don't expect to change during the build. Unfortunately the VFS API does not know _why_ clang is trying to stat a path, so we use the filename as a proxy. Repository: rG LLVM Github Monorepo 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 (Filename == "module.modulemap") + return true; return shouldScanForDirectivesBasedOnExtension(Filename); }
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 (Filename == "module.modulemap") + return true; return shouldScanForDirectivesBasedOnExtension(Filename); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits