This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to fix PR9861
- From: Ian Lance Taylor <ian at airs dot com>
- To: tj at laurenzo dot org
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: 22 Sep 2005 14:28:08 -0700
- Subject: Re: Patch to fix PR9861
- References: <5652dcd5050922141317d2291a@mail.gmail.com>
TJ Laurenzo <tlaurenzo@gmail.com> writes:
> The attached patch corrects PR9861 by including the return type in
> mangled names in the C++ and Java compilers for Java class methods.
> This changes the ABI for Java types but does not make any changes to
> C++ programs that do not access Java types.
How is the demangler going to work with this patch? Is there any way
for the demangler to determine which names are Java names and which
are C++ names? I don't see any obvious way, though I haven't looked
that hard.
If there is no way at present, then I recommend adding a 'J' at the
start of bare-function-type if the return type is encoded. That is,
do this:
<bare-function-type> ::= [J] <type>+
That should be unambiguous.
(I note in passing that your patch is not formatted correctly
according to the GNU standards. The correct formatting would be
something like:
mangle_ret_type = (!DECL_CONSTRUCTOR_P (decl)
&& !DECL_DESTRUCTOR_P (decl)
&& !DECL_CONV_FN_P (decl)
&& (decl_is_template_id (decl, NULL)
|| (DECL_FUNCTION_MEMBER_P (decl)
&& TYPE_FOR_JAVA (DECL_CONTEXT (decl)))));
Thanks.)
Ian