diff options
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 089f40b..c5b9e80 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -465,6 +465,15 @@ static bool loadModuleMapForModuleBuild(CompilerInstance &CI, bool IsSystem, if (SrcMgr.getBufferOrFake(ModuleMapID).getBufferSize() == Offset) Offset = 0; + // Infer framework module if possible. + if (HS.getModuleMap().canInferFrameworkModule(ModuleMap->getDir())) { + SmallString<128> InferredFrameworkPath = ModuleMap->getDir()->getName(); + llvm::sys::path::append(InferredFrameworkPath, + CI.getLangOpts().ModuleName + ".framework"); + if (auto Dir = CI.getFileManager().getDirectory(InferredFrameworkPath)) + (void)HS.getModuleMap().inferFrameworkModule(*Dir, IsSystem, nullptr); + } + return false; } |