diff options
| author | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2014-04-23 19:04:32 +0000 |
|---|---|---|
| committer | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2014-04-23 19:04:32 +0000 |
| commit | 2d94bbb0c014880b67298aac8519cb60416feaf8 (patch) | |
| tree | d280f25883c19a89ac8c452aafcf83de75f88db3 /clang/lib/Frontend | |
| parent | 85f80d7122bf70573ec5da38c3f5f5f3138d355c (diff) | |
| download | bcm5719-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/Frontend')
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 79b96ab6890..b74c288cdaa 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/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; +} |

