summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.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
commit86bb94f55565c8f7a86b4076318ec837741d6212 (patch)
treedb74b55f0929a8bcb713118b67ecab4acbe88852 /lib/Frontend/CompilerInstance.cpp
parent437dc6082910fda186545ef41338f57935ed9ccb (diff)
downloadclang-86bb94f55565c8f7a86b4076318ec837741d6212.tar.gz
clang-86bb94f55565c8f7a86b4076318ec837741d6212.tar.bz2
clang-86bb94f55565c8f7a86b4076318ec837741d6212.tar.xz
Quick fix for layering that broke shared library build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 79b96ab689..b74c288cda 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -1466,3 +1466,29 @@ GlobalModuleIndex *CompilerInstance::loadGlobalModuleIndex(
}
return GlobalIndex;
}
+
+// Check global module index for missing imports.
+bool
+CompilerInstance::lookupMissingImports(StringRef Name,
+ SourceLocation TriggerLoc) {
+ // Look for the symbol in non-imported modules, but only if an error
+ // actually occurred.
+ if (!buildingModule()) {
+ // Load global module index, or retrieve a previously loaded one.
+ GlobalModuleIndex *GlobalIndex = loadGlobalModuleIndex(
+ TriggerLoc);
+
+ // 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(Name, FoundModules))
+ return true;
+ }
+ }
+
+ return false;
+}