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
commit81d577c5c9fa6bd933f29bd4143eea33ce9b6b7c (patch)
treef8bd7c0d528650a0af6c27efc6e4c0b738e53318
parent801e0a3fdebc6c2d22706967874a572846f3e5d8 (diff)
downloadllvm-81d577c5c9fa6bd933f29bd4143eea33ce9b6b7c.zip
llvm-81d577c5c9fa6bd933f29bd4143eea33ce9b6b7c.tar.gz
llvm-81d577c5c9fa6bd933f29bd4143eea33ce9b6b7c.tar.bz2
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. llvm-svn: 135824
-rw-r--r--clang/lib/AST/ASTImporter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index e8e4c6a..d68d240 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/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;
}