[clang][HeaderSearch] Fix implicit module when using header maps
authorIvan Murashko <ivan.murashko@gmail.com>
Sun, 28 May 2023 10:47:29 +0000 (11:47 +0100)
committerIvan Murashko <ivan.murashko@gmail.com>
Sun, 28 May 2023 10:49:51 +0000 (11:49 +0100)
commitf8536fb11e3d71d009c9002b5aa2ef32983ac7dc
tree4a8c084f8825837edcd318afbd623ae66a49134c
parent684facbb43ea0eccc6a579d2373781b422522d2d
[clang][HeaderSearch] Fix implicit module when using header maps

Previously, if a header was found via in a header map, and not just remapped.
we wouldn't also find the module it maps to when using implicit modules (for
module maps that were explicitly loaded).

This diff just updates these code paths to also locate the owning module via
`findUsableModuleForHeader`.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D103930
clang/lib/Lex/HeaderSearch.cpp
clang/test/Modules/implicit-module-header-maps.cpp [new file with mode: 0644]