Tom Tromey wrote:
"David" == David Daney <ddaney@avtrex.com> writes:
David> OK to commit?
There are some whitespace problems with this patch, but otherwise it
is ok. Thanks.
This is an alternative version that I think may be better. From IRC:
(11:47:20 AM) iant_work: daney: I suppose the alternative scheme would
be to use a single string, and also use an encoding for '/'
(11:47:31 AM) iant_work: is there an advantage to breaking it up?
(11:47:39 AM) iant_work: I don't care all that much myself
(11:49:18 AM) daney: I had considered that. Internally to the java
runtime the breaking of the names on '/' signify parts of a path, but as
far as the name is concerned, it probably does not matter.
(11:49:59 AM) iant_work: daney: I don't care all that much; the mangling
will be simpler if you use a single string; but if separate strings is
better for some reason, it's OK with me
(11:50:45 AM) daney: The mangling would be shorter with a single string.
I will change it.
The new version has the form: _ZGr##escaped_name, where ## is the length
of the escaped name. I think the code (in jc1 as well as the
un-mangler) is cleaner and the mangled names are shorter (or the same
length).
This new version also bootstrapped on x86_64 with no failures in libjava.
OK to commit, or do you think the previous version is preferable?
2008-01-22 David Daney <ddaney@avtrex.com>
* class.c (hide) Rename to...
(java_hide_decl) ... this throughout, and make public.
* resource.c (Jr_count): Remove.
(compile_resource_data): Call java_mangle_resource_name to generate
decl name. Make resource decl public and hidden.
* mangle.c (java_mangle_resource_name): New function.
* java-tree.h (java_hide_decl, java_mangle_resource_name): Declare
functions.