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



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


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