This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Enhancing ObjC message lookup in the presence of protocols


Ziemowit Laski wrote:

> My proposal to attack this problem goes as follows: Whenever we see
> an interface or category declaration, we examine the protocols
> adopted by said interface/category and insert their constituent
> method signature into the global class or instance method hash tables
> (as is already being done for methods declared by the 
> interface/category directly). Also, whenever we are dealing with a
> root class (or a category of a root class), we add any instance
> methods from the adopted protocols into the global class hash table
> (just as instance methods directly declared by root classes and 
> categories already are).

Isn't this exactly what my patch did?  The main reason I had to mark the
protocols adopted by root is for the case of forward declared protocols
adopted by root classes in which case we haven't seen the methods yet.

> Such a fix should prevent us from issuing many superfluous warnings 
> when messaging objects of type 'id', 'id <Proto>', 'Class' and (now)
> 'Class <Proto>', and will make things more consistent with what
> happens when you message a specific type (e.g., 'NSObject *').

Not only do we prevent the superfluous warnings, we also use the correct
prototypes for code generation.

Cheers,
David

PS: Will you also send a mail concerning the semantic changes to
objc_comptypes that your implementation has introduced?  I do agree with
some of them, but I don't think that they should be part of this patch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]