From: John Thompson Date: Wed, 7 May 2014 22:47:08 +0000 (+0000) Subject: fmodules-search-all: Removed dead code and added some comments. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b335d96fdee1d31087895cd4eceeeba207049d2e;p=clang fmodules-search-all: Removed dead code and added some comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208259 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index fc07e7273f..52f4c84cb8 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3982,14 +3982,13 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, TypoCorrectionConsumer Consumer(*this, Typo); + // If we're handling a missing symbol error, using modules, and the + // special search all modules option is used, look for a missing import. if ((Mode == CTK_ErrorRecovery) && getLangOpts().Modules && getLangOpts().ModulesSearchAll) { - if (getModuleLoader().lookupMissingImports(Typo->getName(), - TypoName.getLocStart())) { - TypoCorrection TC(TypoName.getName(), (NestedNameSpecifier *)0, 0); - TC.setCorrectionRange(SS, TypoName); - TC.setRequiresImport(true); - } + // The following has the side effect of loading the missing module. + getModuleLoader().lookupMissingImports(Typo->getName(), + TypoName.getLocStart()); } NamespaceSpecifierSet Namespaces(Context, CurContext, SS);