[clang][modules] Infer framework modules in explicit builds
authorJan Svoboda <jan_svoboda@apple.com>
Wed, 23 Feb 2022 13:15:47 +0000 (14:15 +0100)
committerJan Svoboda <jan_svoboda@apple.com>
Wed, 23 Feb 2022 13:46:23 +0000 (14:46 +0100)
commit27d9a58407c44c8bb3fe7b94ff8d3b9bea25afc4
tree4681fdfb89ad377527539e155f52d1d7e70ae865
parent2f300d34decba547dd07f5cd6034a6b2b2ca11a2
[clang][modules] Infer framework modules in explicit builds

This patch enables inferring framework modules in explicit builds in all contexts. Until now, inferring framework modules only worked with `-fimplicit-module-maps` due to this block of code:

```
// HeaderSearch::loadFrameworkModule
  case LMM_InvalidModuleMap:
    // Try to infer a module map from the framework directory.
    if (HSOpts->ImplicitModuleMaps)
      ModMap.inferFrameworkModule(Dir, IsSystem, /*Parent=*/nullptr);
    break;
```

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D113880
clang/include/clang/Lex/ModuleMap.h
clang/lib/Frontend/FrontendAction.cpp
clang/test/Modules/explicit-build-inferred.cpp