diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-07-12 17:38:48 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-07-12 17:38:48 +0000 |
commit | 773c7c4b6e82921b06f4622158f9fcf3e4a44bd2 (patch) | |
tree | 33be4b0d862ea9e5185d53160838f77c34caca44 /clang/lib/Lex/HeaderSearch.cpp | |
parent | 13af7947263ed4441b650a42e6ba2f238386222c (diff) | |
download | bcm5719-llvm-773c7c4b6e82921b06f4622158f9fcf3e4a44bd2.tar.gz bcm5719-llvm-773c7c4b6e82921b06f4622158f9fcf3e4a44bd2.zip |
Revert "[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts"
This reverts commit f40124d4f05ecf4f880cf4e8f26922d861f705f3 / r336660.
This change shouldn't be affecting `@import` behavior, but turns out it is:
https://ci.swift.org/view/swift-master-next/job/oss-swift-incremental-RA-osx-master-next/2800/consoleFull#-12570166563122a513-f36a-4c87-8ed7-cbc36a1ec144
Working on a reduced testcase for this, reverting in the meantime.
rdar://problem/42102222
llvm-svn: 336920
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index b1a2ef12128..312bd2d0615 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -198,15 +198,14 @@ std::string HeaderSearch::getCachedModuleFileName(StringRef ModuleName, return Result.str().str(); } -Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch, - bool AllowExtraModuleMapSearch) { +Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch) { // Look in the module map to determine if there is a module by this name. Module *Module = ModMap.findModule(ModuleName); if (Module || !AllowSearch || !HSOpts->ImplicitModuleMaps) return Module; StringRef SearchName = ModuleName; - Module = lookupModule(ModuleName, SearchName, AllowExtraModuleMapSearch); + Module = lookupModule(ModuleName, SearchName); // The facility for "private modules" -- adjacent, optional module maps named // module.private.modulemap that are supposed to define private submodules -- @@ -217,14 +216,13 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch, // could force building unwanted dependencies into the parent module and cause // dependency cycles. if (!Module && SearchName.consume_back("_Private")) - Module = lookupModule(ModuleName, SearchName, AllowExtraModuleMapSearch); + Module = lookupModule(ModuleName, SearchName); if (!Module && SearchName.consume_back("Private")) - Module = lookupModule(ModuleName, SearchName, AllowExtraModuleMapSearch); + Module = lookupModule(ModuleName, SearchName); return Module; } -Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName, - bool AllowExtraModuleMapSearch) { +Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName) { Module *Module = nullptr; // Look through the various header search paths to load any available module @@ -283,9 +281,8 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName, continue; // Load all module maps in the immediate subdirectories of this search - // directory if ModuleName was from @import. - if (AllowExtraModuleMapSearch) - loadSubdirectoryModuleMaps(SearchDirs[Idx]); + // directory. + loadSubdirectoryModuleMaps(SearchDirs[Idx]); // Look again for the module. Module = ModMap.findModule(ModuleName); |