Make a note for an optimization that I'd like to implement, when the ASTs for local externs are sound

llvm-svn: 147185
This commit is contained in:
Douglas Gregor 2011-12-22 22:05:07 +00:00
parent c4d8d2f155
commit 852e6b7316
1 changed files with 8 additions and 0 deletions

View File

@ -131,6 +131,14 @@ namespace clang {
} }
~RedeclarableResult() { ~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)) if (FirstID && Owning && Reader.PendingDeclChainsKnown.insert(FirstID))
Reader.PendingDeclChains.push_back(FirstID); Reader.PendingDeclChains.push_back(FirstID);
} }