[cfe-commits] [patch] Lookup

John McCall rjmccall at apple.com
Thu Oct 8 10:08:19 PDT 2009


Fariborz Jahanian wrote:
> Is the following part of this patch?

Yes.  I replaced the special scope-manipulation logic in 
PushOnScopeChains with a
call to declarationReplaces;  this was the only change required in 
declarationReplaces.
It's adapted from the following logic in PushOnScopeChains:

} else if (isa<ObjCInterfaceDecl>(D)) {
  // We're pushing an Objective-C interface into the current
  // context. If there is already an alias declaration, remove it first.
  for (IdentifierResolver::iterator
         I = IdResolver.begin(D->getDeclName()), IEnd = IdResolver.end();
       I != IEnd; ++I) {
    if (isa<ObjCCompatibleAliasDecl>(*I)) {
      S->RemoveDecl(DeclPtrTy::make(*I));
      IdResolver.RemoveDecl(*I);
      break;
    }
  }
}

So we used to be replacing alias decls with interface decls in the scope 
chains but not
in the DeclContext's hashtable.  I assume that wasn't some crucial 
distinction.

John.



More information about the cfe-commits mailing list