[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

Cyndy Ishida via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 14 01:13:13 PDT 2025


================
@@ -843,7 +864,7 @@ void ModuleDepCollectorPP::addModuleDep(
         !MDC.isPrebuiltModule(Import)) {
----------------
cyndyishida wrote:

In hindsight, I wish I made this a stacked diff against the real repo.

I have an implementation that addresses this in https://github.com/cyndyishida/llvm-project/commit/272b49206c51c4cc8879c2b539f199c5548fb47a I'd like to merge the current PR and then open a new PR against main for it. But I am open to other suggestions to make the review easier. 

That implementation adds some overhead for two reasons.
1. It deserializes out more content from prebuilt pcm files. 
2. When a module path is fully realized, it traverses down into the leaf dependency and updates whether they are in the sysroot. 

I measured this overhead on a large-ish objc project that uses pch's and toy examples against the macos sdk. I did not observe a noticeable difference.

https://github.com/llvm/llvm-project/pull/130634


More information about the cfe-commits mailing list