This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Enhancing ObjC message lookup in the presence of protocols
- From: David Ayers <d dot ayers at inode dot at>
- To: Ziemowit Laski <zlaski at apple dot com>
- Cc: gcc List <gcc at gcc dot gnu dot org>, objc-language at lists dot apple dot com
- Date: Thu, 14 Oct 2004 16:34:43 +0200
- Subject: Re: RFC: Enhancing ObjC message lookup in the presence of protocols
- References: <728118AE-1BD1-11D9-9ABE-000D9330C50E@apple.com>
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.