diff options
author | Ben Langmuir <blangmuir@apple.com> | 2023-04-03 15:22:20 -0700 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2023-04-04 08:12:10 -0700 |
commit | 8ec36e6956cb03d80f3fee8e593808c43a8a1ec3 (patch) | |
tree | 8eac05c95ed1b112d8921ef6c2c36fee7161d2d7 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 3d9cc946ab4fc9ab9bd5a17c36e5d84f2943062c (diff) | |
download | llvm-8ec36e6956cb03d80f3fee8e593808c43a8a1ec3.zip llvm-8ec36e6956cb03d80f3fee8e593808c43a8a1ec3.tar.gz llvm-8ec36e6956cb03d80f3fee8e593808c43a8a1ec3.tar.bz2 |
[clang][modules] Handle explicit modules when checking for .Private -> _Private
While we eventually want to remove the mapping from .Private to _Private
modules, until we do, ensure that it behaves the same for explicit
modules.
rdar://107449872
Differential Revision: https://reviews.llvm.org/D147477
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 691f779..51fe776 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -2026,8 +2026,12 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, PrivateModule, PP->getIdentifierInfo(Module->Name)->getTokenID()); PrivPath.push_back(std::make_pair(&II, Path[0].second)); + std::string FileName; + // If there is a modulemap module or prebuilt module, load it. if (PP->getHeaderSearchInfo().lookupModule(PrivateModule, ImportLoc, true, - !IsInclusionDirective)) + !IsInclusionDirective) || + selectModuleSource(nullptr, PrivateModule, FileName, BuiltModules, + PP->getHeaderSearchInfo()) != MS_ModuleNotFound) Sub = loadModule(ImportLoc, PrivPath, Visibility, IsInclusionDirective); if (Sub) { MapPrivateSubModToTopLevel = true; |