summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-22 22:05:07 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-22 22:05:07 +0000
commit852e6b7316ce89c66631b95dbd7b76a3a442842d (patch)
treee134ef73ce5ae032485c4154d0ab1f07ce857740
parentc4d8d2f155bb755ef2312f81d3035ca7338eb1d0 (diff)
downloadbcm5719-llvm-852e6b7316ce89c66631b95dbd7b76a3a442842d.tar.gz
bcm5719-llvm-852e6b7316ce89c66631b95dbd7b76a3a442842d.zip
Make a note for an optimization that I'd like to implement, when the ASTs for local externs are sound
llvm-svn: 147185
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index cb816632bdd..3819191e0c2 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -131,6 +131,14 @@ namespace clang {
}
~RedeclarableResult() {
+ // FIXME: We want to suppress this when the declaration is local to
+ // a function, since there's no reason to search other AST files
+ // for redeclarations (they can't exist). However, this is hard to
+ // do locally because the declaration hasn't necessarily loaded its
+ // declaration context yet. Also, local externs still have the function
+ // as their (semantic) declaration context, which is wrong and would
+ // break this optimize.
+
if (FirstID && Owning && Reader.PendingDeclChainsKnown.insert(FirstID))
Reader.PendingDeclChains.push_back(FirstID);
}
OpenPOWER on IntegriCloud