This is an archive of the discontinued LLVM Phabricator instance.

[Modules] Skip adding unused module maps to the dependency file
AbandonedPublic

Authored by bruno on Mar 28 2018, 7:34 PM.

Details

Reviewers
rsmith
Summary

Current generation of dependency files when modules is on take into
account all parsed module maps found while searching for a specific
module.

Add a new cc1 flag that allows changing that behavior: only add module
maps that actually answer for the modules being searched for.

Diff Detail

Event Timeline

bruno created this revision.Mar 28 2018, 7:34 PM

This feature seems reasonable to me.

lib/Frontend/DependencyFile.cpp
206–223

I wonder whether it'd be clearer to have two different callbacks for the two behaviors here, rather than one callback that essentially does one of two completely different things.

lib/Lex/ModuleMap.cpp
728–735

Does the right thing happen when we load module map information from a PCM file?

I'm also worried that this will fire at the wrong times (eg, more than once per module, or not at all if the module is only ever found by header lookup). Perhaps we should instead trigger the callback when the module is first imported?

bruno abandoned this revision.Nov 5 2020, 7:04 PM