[cfe-commits] [patch] Lookup

Fariborz Jahanian fjahanian at apple.com
Thu Oct 8 08:19:27 PDT 2009


Is the following part of this patch?

- fariborz

Index: lib/AST/Decl.cpp
===================================================================
--- lib/AST/Decl.cpp	(revision 83513)
+++ lib/AST/Decl.cpp	(working copy)
@@ -299,6 +299,9 @@ bool NamedDecl::declarationReplaces(Name
    if (isa<ObjCMethodDecl>(this))
      return false;

+  if (isa<ObjCInterfaceDecl>(this) && isa<ObjCCompatibleAliasDecl> 
(OldD))
+    return true;
+
    // For non-function declarations, if the declarations are of the
    // same kind then this must be a redeclaration, or semantic analysis
    // would not have given us the new declaration.


On Oct 7, 2009, at 5:42 PM, John McCall wrote:

> This patch refactors and hopefully simplifies and clarifies some of  
> the logic in name lookup, mostly for the benefit of C++.  The major  
> structural change is that a LookupResult is now a non-POD type which  
> is passed by reference to the lookup routines;  this allows us to  
> eliminate a lot of unnecessary copies from C++ lookups that reach  
> into multiple scopes.  No allocations or extra logic are required in  
> the common case, and along the common C paths, where only a single  
> declaration is found.
>
> In addition, the logic to replace declarations in scope chains is  
> now identical to that in declarationReplaces, and we no longer rely  
> on the ordering of declarations within a single scope to implement C+ 
> + tag-name shadowing.
>
> In addition, users which assume that lookup will find at most one  
> declaration must now explicitly call either LookupSingleName or, if  
> working with a LookupResult, getAsSingleDecl().  These methods exist  
> to mark users making this assumption.  Users which for some reason  
> are certain that at most one declaration can be returned should use  
> getFoundDecl() instead.
>
> My performance evaluations show a (very) small gain on the Cocoa.h  
> benchmark.
>
> John.
> <lookup.patch.txt>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list