This is the mail archive of the gcc-patches@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: Your 'Class <Protocol>' Work


On 5 Oct 2004, at 9.34, David Ayers wrote:

Ziemowit Laski wrote:
Took me longer than expected, but here is the alternative patch I
promised; no ChangeLog entries for now.  It's running a bit late, so
I'll defer my commentary until tomorrow. :-(  As always, feedback is
welcome.

Hello Zem,


well I guess we have different views on a gratuitous rewriting of
objc_comptypes :-), but your version seems fine.

Good to hear it. :-)

The test case you attached fails with the patch: Excess errors: [...]/class-protocol-1.m:50: warning: `+doItInstance1' not implemented by protocol(s) [...]/class-protocol-1.m:92: warning: no `+doItInstance3' method found [...]/class-protocol-1.m:133: warning: no `+doItInstance5' method found [...]/class-protocol-1.m:138: warning: `+doItInstance1' not implemented by protocol(s) [...]/class-protocol-1.m:195: warning: no `+doItInstance7' method found [...]/class-protocol-1.m:198: warning: `+doItInstance7' not implemented by protocol(s) [...]/class-protocol-1.m:230: warning: no `+doItInstance8' method found [...]/class-protocol-1.m:232: warning: no `+doItInstance9' method found

I could have sworn this worked for me, but I'll check again (and also incorporate all of the comments you had below).


You seem to have omitted the part which is /very/ important to me.
Please! search for instance prototypes in protocol qualified Class
references! What is your issue with this feature? It is very important
in my view wrt generating the right code. I do not understand what is
bothering you about it. I can live with doing it independent of whether
the protocol is adopted by the root class. But please do it for those
that are.

My patch was only a work in progress (hence no ChangeLogs yet), but yes,
the protocols in question should be searched for a matching instance
prototype as a fallback, and if one is found, a suitable warning should
be issued. If that yields no result either, then we give the "not implemented
by protocol(s)" warning and do the unadorned 'Class' search (which will give
us instance methods implemented by root classes). I will do this in the
next rev of my patch; please stay tuned.


Note also that my patch intentionally skirts the various cleanup/renaming issues
we've discussed; we can do those later separately. I also realized that my
suggestion for renaming 'reflexive' to 'symmetric' is wrong :-(; a symmetric
operation is one for which ((A op B) && (B op A)), whereas objc_comptypes()
is really implementing ((A op B) || (B op A)). We really should rewrite
objc_comptypes() at some point so that it behaves more like C/C++ comptypes().


--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]