]> granicus.if.org Git - clang/commitdiff
fmodules-search-all: Removed dead code and added some comments.
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>
Wed, 7 May 2014 22:47:08 +0000 (22:47 +0000)
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>
Wed, 7 May 2014 22:47:08 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208259 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp

index fc07e7273fcefafe30a462b1e2b3960fa7a711d4..52f4c84cb8cfe52970dad7b2ca2303614948009e 100644 (file)
@@ -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);