[all-commits] [llvm/llvm-project] cbd5ba: [Modules] Don't search for modulemaps in the immed...

Volodymyr Sapsai via All-commits all-commits at lists.llvm.org
Tue Jul 23 14:00:05 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cbd5ba20d1faf88dbfc9aa491d8def1920500a32
      https://github.com/llvm/llvm-project/commit/cbd5ba20d1faf88dbfc9aa491d8def1920500a32
  Author: Volodymyr Sapsai <vsapsai at apple.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Lex/HeaderSearchOptions.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/Darwin.cpp
    M clang/lib/Lex/HeaderSearch.cpp
    A clang/test/Driver/modulemap-allow-subdirectory-search.c
    A clang/test/Modules/modulemap-allow-subdirectory-search.m

  Log Message:
  -----------
  [Modules] Don't search for modulemaps in the immediate sub-directories of search paths for recent Apple SDKs. (#100005)

Such searches can be costly and non-intuitive. We've seen complaints
from developers that they don't expect clang to find modules on their
own and not in search paths that developers provide. Keeping the search
of modulemaps in subdirectories for code completion as it provides
better user experience.

If you are defining module "UsefulCode" in
"include/UnrelatedName/module.modulemap", it is recommended to rename
the directory "UnrelatedName" to "UsefulCode". If you cannot do so, you
can add to "include/module.modulemap" a line like `extern module
UsefulCode "UnrelatedName/module.modulemap"`, so clang can find module
"UsefulCode" without checking each subdirectory in "include/".

rdar://106677321

---------

Co-authored-by: Jan Svoboda <jan at svoboda.ai>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list