aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-07-22 23:46:03 +0000
committerSean Callanan <scallanan@apple.com>2011-07-22 23:46:03 +0000
commit8cc4fd795e01d50a7a7c96f4c0356d23b00d9349 (patch)
treefab10ee5b17a4b69f7680250e0c482037d46a1d5
parentcfe1bcb440ef2fde5e0df6e07a5abbeee089e6e7 (diff)
This patch (thanks to Doug Gregor) fixes a
problem where Clang was setting the hasExternalVisibleDecls() bit for all DeclContexts it imported. This caused Clang to make unnecessary calls to findExternalVisibleDecls() when an external AST source was installed. In fact, Clang sometimes interpreted a failure by one of these spurious calls to find a Decl as meaning the Decl didn't exist, even though findExternalLexicalDecls() did locate that decl. This produced amusing errors of the form: - error: no member named 'b' in 'A'; did you mean 'b'? - Now, if hasExternalVisibleDecls() or hasExternalLexicalDecls() should be set, the external AST source must do so itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135824 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/ASTImporter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp
index e8e4c6a108..d68d240346 100644
--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -1767,10 +1767,7 @@ ASTNodeImporter::ImportDeclarationNameLoc(const DeclarationNameInfo &From,
void ASTNodeImporter::ImportDeclContext(DeclContext *FromDC, bool ForceImport) {
if (Importer.isMinimalImport() && !ForceImport) {
- if (DeclContext *ToDC = Importer.ImportContext(FromDC)) {
- ToDC->setHasExternalLexicalStorage();
- ToDC->setHasExternalVisibleStorage();
- }
+ Importer.ImportContext(FromDC);
return;
}