[PATCH] D148776: [Modules] Move modulemaps to header search directories. NFC intended.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 19:06:20 PDT 2023


vsapsai added a comment.

In D148776#4328425 <https://reviews.llvm.org/D148776#4328425>, @dblaikie wrote:

> Got a link to a design discussion motivating this change?

No design discussion. I though that doing less work is not contentious.

> I'd have thought it made sense to put modulemaps in subdirectories - since they cover the whole directory, putting them in the root of an include path would be problematic if there are multiple distinct projects in that same path. And I didn't think this involved searching through subdirectories, but walking up parent directories from the included file...

When we look for a module map covering a header - you are right, we are walking up parent directories from the included file. But when we are looking up a module by name (for example, when we load a module), there is no included file and we need to look for a module top-down instead of bottom-up.

Your suggested approach to put module maps in corresponding subdirectories works when the names are the same, for example, module "blue" in directory "blue", that remains unchanged. But, for example, module "LLVM_DebugInfo" in directory "llvm" is not obvious. And there is no indication it //must// be in directory "llvm" and not in "llvm-c" or in some other directory, so clang checks all subdirectories.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148776/new/

https://reviews.llvm.org/D148776



More information about the cfe-commits mailing list