summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>2014-04-23 19:04:32 +0000
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>2014-04-23 19:04:32 +0000
commit2d94bbb0c014880b67298aac8519cb60416feaf8 (patch)
treed280f25883c19a89ac8c452aafcf83de75f88db3 /clang/lib/Sema/SemaLookup.cpp
parent85f80d7122bf70573ec5da38c3f5f5f3138d355c (diff)
downloadbcm5719-llvm-2d94bbb0c014880b67298aac8519cb60416feaf8.tar.gz
bcm5719-llvm-2d94bbb0c014880b67298aac8519cb60416feaf8.zip
Quick fix for layering that broke shared library build.
llvm-svn: 207011
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index c0d49a7dd94..e8ef5ac6b98 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -23,8 +23,6 @@
#include "clang/AST/ExprCXX.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/LangOptions.h"
-#include "clang/Lex/HeaderSearch.h"
-#include "clang/Lex/ModuleLoader.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/ExternalSemaSource.h"
@@ -35,8 +33,6 @@
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/TemplateDeduction.h"
#include "clang/Sema/TypoCorrection.h"
-#include "clang/Serialization/GlobalModuleIndex.h"
-#include "clang/Serialization/Module.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
@@ -3986,29 +3982,13 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName,
TypoCorrectionConsumer Consumer(*this, Typo);
- // Get the module loader (usually compiler instance).
- ModuleLoader &Loader = PP.getModuleLoader();
-
- // Look for the symbol in non-imported modules, but only if an error
- // actually occurred.
- if ((Mode == CTK_ErrorRecovery) && !Loader.buildingModule() &&
- getLangOpts().Modules && getLangOpts().ModulesSearchAll) {
- // Load global module index, or retrieve a previously loaded one.
- GlobalModuleIndex *GlobalIndex = Loader.loadGlobalModuleIndex(
- TypoName.getLocStart());
-
- // Only if we have a global index.
- if (GlobalIndex) {
- GlobalModuleIndex::HitSet FoundModules;
-
- // Find the modules that reference the identifier.
- // Note that this only finds top-level modules.
- // We'll let diagnoseTypo find the actual declaration module.
- if (GlobalIndex->lookupIdentifier(Typo->getName(), FoundModules)) {
- TypoCorrection TC(TypoName.getName(), (NestedNameSpecifier *)0, 0);
- TC.setCorrectionRange(SS, TypoName);
- TC.setRequiresImport(true);
- }
+ if ((Mode == CTK_ErrorRecovery) && getLangOpts().Modules &&
+ getLangOpts().ModulesSearchAll) {
+ if (PP.getModuleLoader().lookupMissingImports(Typo->getName(),
+ TypoName.getLocStart())) {
+ TypoCorrection TC(TypoName.getName(), (NestedNameSpecifier *)0, 0);
+ TC.setCorrectionRange(SS, TypoName);
+ TC.setRequiresImport(true);
}
}
OpenPOWER on IntegriCloud