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: Patch to fix PR9861


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


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