This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Avoid generating arguments for missing module map files
AbandonedPublic

Authored by jansvoboda11 on Aug 23 2021, 5:04 AM.

Details

Summary

Only modules that were built from preprocessed sources have PresumedModuleMapFile. Encode the optionality into the type system and avoid generating the -fmodule-map-file= arguments in such cases.

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Aug 23 2021, 5:04 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2021, 5:04 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Is there a way to test this?

dexonsmith requested changes to this revision.Aug 23 2021, 9:56 AM

Is there a way to test this?

Marking "request changes" for clarity.

Since this drops -fmodule-map-file= arguments, I imagine you can add a test that demonstrates it. But if that's currently awkward to observe because you need another piece to land in a follow-up, I'm fine to delay testing until then.

This revision now requires changes to proceed.Aug 23 2021, 9:56 AM
jansvoboda11 planned changes to this revision.EditedAug 24 2021, 10:49 AM

I created D108647 to more directly/correctly address the issues I'm seeing at the moment in explicit builds.

I think dealing with the possibility of empty PresumedModuleMapFile is still valuable, but I'm not aware how to test this at the moment (create module from non-preprocessed sources).

I created D108647 to more directly/correctly address the issues I'm seeing at the moment in explicit builds.

I think dealing with the possibility of empty PresumedModuleMapFile is still valuable, but I'm not aware how to test this at the moment (create module from non-preprocessed sources).

I'm not sure it is possible, based it being filled in always in ASTReader.cpp. I think this changed in ab75597ddac52f24e9cbd794cded195262ef670e but the comment wasn't updated. I suggest adding an assert that the module map file is not empty.

jansvoboda11 abandoned this revision.Sep 3 2021, 5:55 AM