This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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 (reprise)


TJ Laurenzo <tlaurenzo@gmail.com> writes:

> This is a followup to the patches discussed on the thread
> http://gcc.gnu.org/ml/gcc-patches/2005-09/msg01448.html
> 
> The attached patches contain all changes to the original patch
> discussed in the above thread.   I have bootstrapped the compiler on
> i686-pc-linux-gnu and verified that this patch does not introduce any
> testsuite failures.
> 
> This patch contains the following files:
>    - pr9861-base.diff : Patches to the libiberty and include directories
>    - pr9861-base-cl.diff : ChangeLog patches for libiberty and include
>    - pr9861-gcc.diff : Patches to gcc
>    - pr9861-gcc-cl.diff : ChangeLog patches for gcc
> 
> Andrew Haley has pointed out that application of the gcc patches needs
> some careful timing.  Pending approval, the base patches to libiberty
> should be applied as soon as possible so that binutils and gdb support
> for the new Java mangling scheme exists in cvs snapshots by the time
> the gcc patches are commited.

[ Please try to give your attachments a MIME type of text/plain or
  text/x-patch, not application/octet-stream.  Thanks. ]

*************** d_print_comp (struct d_print_info *dpi,
*** 3025,3037 ****
  
      case DEMANGLE_COMPONENT_FUNCTION_TYPE:
        {
  	if (d_left (dc) != NULL)
  	  {
  	    struct d_print_mod dpm;
  
  	    /* We must pass this type down as a modifier in order to
  	       print it in the right location.  */
! 
  	    dpm.next = dpi->modifiers;
  	    dpi->modifiers = &dpm;
  	    dpm.mod = dc;
--- 3034,3050 ----
  
      case DEMANGLE_COMPONENT_FUNCTION_TYPE:
        {
+ 	if ((dpi->options & DMGL_RET_POSTFIX) != 0)
+ 	  d_print_function_type (dpi, dc, dpi->modifiers);
+ 
+ 	/* Print return type if present */
  	if (d_left (dc) != NULL)
  	  {
  	    struct d_print_mod dpm;
  
  	    /* We must pass this type down as a modifier in order to
  	       print it in the right location.  */
! 	    
  	    dpm.next = dpi->modifiers;
  	    dpi->modifiers = &dpm;
  	    dpm.mod = dc;


Don't add spaces to the blank line after the comment.


        result = cplus_demangle (input.data,
! 			       DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES|
! 			       (ret_postfix ? DMGL_RET_POSTFIX : 0));

Correct GNU indentation is something like:

  result = cplus_demangle (input.data,
			   (DMGL_PARAMS | DMGL_ANSI | DMGL_TYPES
			    | (ret_postfix ? DMGL_RET_POSTFIX : 0)));

(i.e., put the operator at the start of the continuation line).

  
+ 	PR java/9861
+ 	* cp-demangle.c (d_bare_function_type): Recognize new 'J' qualifier
+ 	and include return type when found.
+ 	* cp-demangle.c (d_print_comp/DEMANGLE_COMPONENT_FUNCTION_TYPE):
+ 	Add conditional logic to change printing order of return type
+ 	when the DMGL_RET_POSTFIX option is present.
+ 	* cp-demangle.c (java_demangle_v3): Add DMGL_RET_POSTFIX option to
+ 	d_demangle call
+ 	* testsuite/test-demangle.c (main): Recognize option --ret-postfix
+ 	* testsuite/demangle-expected: Test cases to verify extended encoding.
+ 	Updated comment to document --ret-postfix option.

Don't repeat "cp-demangle.c".  Use [] for parts of a function.  E.g.:

	* cp-demangle.c (d_bare_function_type): Recognize new 'J' qualifier
	and include return type when found.
	(d_print_comp) [DEMANGLE_COMPONENT_FUNCTION_TYPE]: Add
	conditional logic to change printing order of return type when
	the DMGL_RET_POSTFIX option is present.
	(java_demangle_v3): Add DMGL_RET_POSTFIX option to d_demangle
	call.

This patch to libiberty and include is approved with those changes
provided the rest of the patch is approved.

Ian


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