]> granicus.if.org Git - clang/commitdiff
Make a note for an optimization that I'd like to implement, when the ASTs for local...
authorDouglas Gregor <dgregor@apple.com>
Thu, 22 Dec 2011 22:05:07 +0000 (22:05 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 22 Dec 2011 22:05:07 +0000 (22:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147185 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReaderDecl.cpp

index cb816632bdd9373edf7b003994617cebcccc1dbf..3819191e0c291bd967a7dbb28f721120fe5ece10 100644 (file)
@@ -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);
       }