diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-25 22:20:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-25 22:20:13 +0000 |
commit | 8cebe37fe9e1f56deb7e47f5aefa647960cdd840 (patch) | |
tree | 6675477db77032f69e1a6eb4b0ead08acaf63a0e /clang/lib/Frontend/CompilerInstance.cpp | |
parent | e9401f61c26689c3029090dd4c4d8469c61d598e (diff) | |
download | llvm-8cebe37fe9e1f56deb7e47f5aefa647960cdd840.zip llvm-8cebe37fe9e1f56deb7e47f5aefa647960cdd840.tar.gz llvm-8cebe37fe9e1f56deb7e47f5aefa647960cdd840.tar.bz2 |
[modules] Even if we already have a definition of a class, loading in another
one can give us more lookup results (due to implicit special members). Be sure
to complete the redecl chain for every kind of DeclContext before performing a
lookup into it, rather than only doing so for NamespaceDecls.
llvm-svn: 230558
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index fc97981..07812bd 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1288,8 +1288,11 @@ bool CompilerInstance::loadModuleFile(StringRef FileName) { bool needsImportVisitation() const override { return true; } void visitImport(StringRef FileName) override { - if (!CI.ExplicitlyLoadedModuleFiles.insert(FileName).second) + if (!CI.ExplicitlyLoadedModuleFiles.insert(FileName).second) { + if (ModuleFileStack.size() == 0) + TopFileIsModule = true; return; + } ModuleFileStack.push_back(FileName); if (ASTReader::readASTFileControlBlock(FileName, CI.getFileManager(), |