[cfe-commits] r147185 - /cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Douglas Gregor
dgregor at apple.com
Thu Dec 22 14:05:07 PST 2011
Author: dgregor
Date: Thu Dec 22 16:05:07 2011
New Revision: 147185
URL: http://llvm.org/viewvc/llvm-project?rev=147185&view=rev
Log:
Make a note for an optimization that I'd like to implement, when the ASTs for local externs are sound
Modified:
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=147185&r1=147184&r2=147185&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Thu Dec 22 16:05:07 2011
@@ -131,6 +131,14 @@
}
~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);
}
More information about the cfe-commits
mailing list