@@ -2008,10 +2008,9 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
2008
2008
PrivateModule, PP->getIdentifierInfo (Module->Name )->getTokenID ());
2009
2009
PrivPath.push_back (std::make_pair (&II, Path[0 ].second ));
2010
2010
2011
- if (PP->getHeaderSearchInfo ().lookupModule (PrivateModule, ImportLoc,
2012
- true , !IsInclusionDirective))
2013
- Sub =
2014
- loadModule (ImportLoc, PrivPath, Visibility, IsInclusionDirective);
2011
+ if (PP->getHeaderSearchInfo ().lookupModule (PrivateModule, ImportLoc, true ,
2012
+ !IsInclusionDirective))
2013
+ Sub = loadModule (ImportLoc, PrivPath, Visibility, IsInclusionDirective);
2015
2014
if (Sub) {
2016
2015
MapPrivateSubModToTopLevel = true ;
2017
2016
if (!getDiagnostics ().isIgnored (
@@ -2034,9 +2033,9 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
2034
2033
unsigned BestEditDistance = (std::numeric_limits<unsigned >::max)();
2035
2034
2036
2035
for (class Module *SubModule : Module->submodules ()) {
2037
- unsigned ED = Name. edit_distance (SubModule-> Name ,
2038
- /* AllowReplacements= */ true ,
2039
- BestEditDistance);
2036
+ unsigned ED =
2037
+ Name. edit_distance (SubModule-> Name ,
2038
+ /* AllowReplacements= */ true , BestEditDistance);
2040
2039
if (ED <= BestEditDistance) {
2041
2040
if (ED < BestEditDistance) {
2042
2041
Best.clear ();
@@ -2049,12 +2048,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
2049
2048
2050
2049
// If there was a clear winner, user it.
2051
2050
if (Best.size () == 1 ) {
2052
- getDiagnostics ().Report (Path[I].second ,
2053
- diag::err_no_submodule_suggest)
2054
- << Path[I].first << Module->getFullModuleName () << Best[0 ]
2055
- << SourceRange (Path[0 ].second , Path[I-1 ].second )
2056
- << FixItHint::CreateReplacement (SourceRange (Path[I].second ),
2057
- Best[0 ]);
2051
+ getDiagnostics ().Report (Path[I].second , diag::err_no_submodule_suggest)
2052
+ << Path[I].first << Module->getFullModuleName () << Best[0 ]
2053
+ << SourceRange (Path[0 ].second , Path[I - 1 ].second )
2054
+ << FixItHint::CreateReplacement (SourceRange (Path[I].second ),
2055
+ Best[0 ]);
2058
2056
2059
2057
Sub = Module->findSubmodule (Best[0 ]);
2060
2058
}
@@ -2064,8 +2062,8 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
2064
2062
// No submodule by this name. Complain, and don't look for further
2065
2063
// submodules.
2066
2064
getDiagnostics ().Report (Path[I].second , diag::err_no_submodule)
2067
- << Path[I].first << Module->getFullModuleName ()
2068
- << SourceRange (Path[0 ].second , Path[I- 1 ].second );
2065
+ << Path[I].first << Module->getFullModuleName ()
2066
+ << SourceRange (Path[0 ].second , Path[I - 1 ].second );
2069
2067
break ;
2070
2068
}
2071
2069
0 commit comments