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: Ziemowit Laski <zlaski at apple dot com>
- To: David Ayers <d dot ayers at inode dot at>
- Cc: gcc List <gcc at gcc dot gnu dot org>, objc-language at lists dot apple dot com
- Date: Thu, 14 Oct 2004 14:14:04 -0700
- Subject: Re: RFC: Enhancing ObjC message lookup in the presence of protocols
- References: <728118AE-1BD1-11D9-9ABE-000D9330C50E@apple.com> <416E8E83.7000409@inode.at>
On 14 Oct 2004, at 7.34, David Ayers 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.
Your patch did more than that, I think, but overall you do raise a good
point. Either we should handle forward-declared protocols as you
suggest,
or else I should drop the second part of my proposal. At any rate,
let's defer this to the next patch, and separate it from adding
'Class <Proto>' to the compiler in the first place.
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.
Which ones do you mean? I did notice that objc_comptypes is buggy in
some cases (marked as FIXMEs in class-protocol-1.m), but I resisted
mission creep in that case, since these bugs can be fixed as part of
a future objc_comptypes rewrite.
Aside from this, do you see any other problems with my current patch?
I know it still doesn't do everything you want, and you do raise
a good point about forward-declared protocols, but we should separate
concerns here and attack remaining problems with a separate patch.
Thanks,
--Zem
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477