public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch to fix PR9861 (reprise)
@ 2005-09-27 18:27 TJ Laurenzo
  2005-09-27 18:53 ` Andrew Haley
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: TJ Laurenzo @ 2005-09-27 18:27 UTC (permalink / raw)
  To: gcc-patches, java-patches

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

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.

TJ

[-- Attachment #2: pr9861-base.diff --]
[-- Type: application/octet-stream, Size: 8171 bytes --]

Index: libiberty/cp-demangle.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libiberty/cp-demangle.c,v
retrieving revision 1.83
diff -c -3 -p -r1.83 cp-demangle.c
*** libiberty/cp-demangle.c	1 Jul 2005 16:39:35 -0000	1.83
--- libiberty/cp-demangle.c	27 Sep 2005 17:41:39 -0000
*************** d_function_type (struct d_info *di)
*** 1939,1945 ****
    return ret;
  }
  
! /* <bare-function-type> ::= <type>+  */
  
  static struct demangle_component *
  d_bare_function_type (struct d_info *di, int has_return_type)
--- 1939,1945 ----
    return ret;
  }
  
! /* <bare-function-type> ::= [J]<type>+  */
  
  static struct demangle_component *
  d_bare_function_type (struct d_info *di, int has_return_type)
*************** d_bare_function_type (struct d_info *di,
*** 1947,1959 ****
    struct demangle_component *return_type;
    struct demangle_component *tl;
    struct demangle_component **ptl;
  
    return_type = NULL;
    tl = NULL;
    ptl = &tl;
    while (1)
      {
-       char peek;
        struct demangle_component *type;
  
        peek = d_peek_char (di);
--- 1947,1968 ----
    struct demangle_component *return_type;
    struct demangle_component *tl;
    struct demangle_component **ptl;
+   char peek;
+ 
+   /* Detect special qualifier indicating that the first argument
+      is the return type.  */
+   peek = d_peek_char (di);
+   if (peek == 'J')
+     {
+       d_advance (di, 1);
+       has_return_type = 1;
+     }
  
    return_type = NULL;
    tl = NULL;
    ptl = &tl;
    while (1)
      {
        struct demangle_component *type;
  
        peek = d_peek_char (di);
*************** 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;
*************** d_print_comp (struct d_print_info *dpi,
*** 3045,3054 ****
  	    if (dpm.printed)
  	      return;
  
! 	    d_append_char (dpi, ' ');
  	  }
  
! 	d_print_function_type (dpi, dc, dpi->modifiers);
  
  	return;
        }
--- 3058,3071 ----
  	    if (dpm.printed)
  	      return;
  
! 	    /* In standard prefix notation, there is a space between the
! 	       return type and the function signature.  */
! 	    if ((dpi->options & DMGL_RET_POSTFIX) == 0)
! 	      d_append_char (dpi, ' ');
  	  }
  
! 	if ((dpi->options & DMGL_RET_POSTFIX) == 0) 
! 	  d_print_function_type (dpi, dc, dpi->modifiers);
  
  	return;
        }
*************** java_demangle_v3 (const char* mangled)
*** 4003,4009 ****
    char *from;
    char *to;
  
!   demangled = d_demangle (mangled, DMGL_JAVA | DMGL_PARAMS, &alc);
  
    if (demangled == NULL)
      return NULL;
--- 4020,4027 ----
    char *from;
    char *to;
  
!   demangled = d_demangle (mangled, DMGL_JAVA | DMGL_PARAMS | DMGL_RET_POSTFIX, 
! 			  &alc);
  
    if (demangled == NULL)
      return NULL;
Index: libiberty/testsuite/test-demangle.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libiberty/testsuite/test-demangle.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 test-demangle.c
*** libiberty/testsuite/test-demangle.c	17 Aug 2005 03:31:04 -0000	1.6
--- libiberty/testsuite/test-demangle.c	27 Sep 2005 17:41:39 -0000
*************** exp: %s\n",
*** 114,119 ****
--- 114,120 ----
       --is-v3-ctor        Calls is_gnu_v3_mangled_ctor on input; expected
                           output is an integer representing ctor_kind.
       --is-v3-dtor        Likewise, but for dtors.
+      --ret-postfix       Passes the DMGL_RET_POSTFIX option
  
     For compatibility, just in case it matters, the options line may be
     empty, to mean --format=auto.  If it doesn't start with --, then it
*************** main(argc, argv)
*** 129,134 ****
--- 130,136 ----
    int no_params;
    int is_v3_ctor;
    int is_v3_dtor;
+   int ret_postfix;
    struct line format;
    struct line input;
    struct line expect;
*************** main(argc, argv)
*** 158,163 ****
--- 160,166 ----
        tests++;
  
        no_params = 0;
+       ret_postfix = 0;
        is_v3_ctor = 0;
        is_v3_dtor = 0;
        if (format.data[0] == '\0')
*************** main(argc, argv)
*** 212,217 ****
--- 215,222 ----
  		is_v3_ctor = 1;
  	      else if (strcmp (opt, "--is-v3-dtor") == 0)
  		is_v3_dtor = 1;
+ 	      else if (strcmp (opt, "--ret-postfix") == 0)
+ 		ret_postfix = 1;
  	      else
  		{
  		  printf ("FAIL at line %d: unrecognized option %s\n",
*************** main(argc, argv)
*** 255,261 ****
        cplus_demangle_set_style (style);
  
        result = cplus_demangle (input.data,
! 			       DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES);
  
        if (result
  	  ? strcmp (result, expect.data)
--- 260,267 ----
        cplus_demangle_set_style (style);
  
        result = cplus_demangle (input.data,
! 			       DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES|
! 			       (ret_postfix ? DMGL_RET_POSTFIX : 0));
  
        if (result
  	  ? strcmp (result, expect.data)
Index: libiberty/testsuite/demangle-expected
===================================================================
RCS file: /cvsroot/gcc/gcc/libiberty/testsuite/demangle-expected,v
retrieving revision 1.33
diff -c -3 -p -r1.33 demangle-expected
*** libiberty/testsuite/demangle-expected	1 Jul 2005 16:39:36 -0000	1.33
--- libiberty/testsuite/demangle-expected	27 Sep 2005 17:41:39 -0000
***************
*** 11,16 ****
--- 11,17 ----
  #    --is-v3-ctor        Calls is_gnu_v3_mangled_ctor on input; expected
  #                        output is an integer representing ctor_kind.
  #    --is-v3-dtor        Likewise, but for dtors.
+ #    --ret-postfix       Passes the DMGL_RET_POSTFIX option
  #
  #  For compatibility, just in case it matters, the options line may be
  #  empty, to mean --format=auto.  If it doesn't start with --, then it
*************** _test_array__L_1__B23b___clean.6
*** 3781,3783 ****
--- 3782,3807 ----
  --format=java
  _ZGAN4java4lang5Class7forNameEPNS0_6StringE
  hidden alias for java.lang.Class.forName(java.lang.String)
+ #
+ # Test cases to verify encoding that determines if a return type is present
+ # Related to PR9861
+ --format=java
+ _ZN4java4lang4Math4acosEJdd
+ java.lang.Math.acos(double)double
+ #
+ --format=auto
+ _ZN4java4lang4Math4acosEJdd
+ double java::lang::Math::acos(double)
+ #
+ --format=auto
+ _ZN4java4lang4Math4acosEJvd
+ void java::lang::Math::acos(double)
+ #
+ --format=auto --ret-postfix
+ _ZN4java4lang4Math4acosEJdd
+ java::lang::Math::acos(double)double
+ #
+ --format=gnu-v3 --no-params --ret-postfix
+ _Z4makeI7FactoryiET_IT0_Ev
+ make<Factory, int>()Factory<int>
+ make<Factory, int>
Index: include/demangle.h
===================================================================
RCS file: /cvsroot/gcc/gcc/include/demangle.h,v
retrieving revision 1.29
diff -c -3 -p -r1.29 demangle.h
*** include/demangle.h	25 May 2005 23:29:53 -0000	1.29
--- include/demangle.h	27 Sep 2005 17:41:39 -0000
*************** extern "C" {
*** 35,40 ****
--- 35,42 ----
  #define DMGL_JAVA	 (1 << 2)	/* Demangle as Java rather than C++. */
  #define DMGL_VERBOSE	 (1 << 3)	/* Include implementation details.  */
  #define DMGL_TYPES	 (1 << 4)	/* Also try to demangle type encodings.  */
+ #define DMGL_RET_POSTFIX (1 << 5)       /* Print function return types (when
+                                            present) after function signature */
  
  #define DMGL_AUTO	 (1 << 8)
  #define DMGL_GNU	 (1 << 9)

[-- Attachment #3: pr9861-base-cl.diff --]
[-- Type: application/octet-stream, Size: 1514 bytes --]

Index: libiberty/ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/libiberty/ChangeLog,v
retrieving revision 1.604
diff -c -0 -r1.604 ChangeLog
*** libiberty/ChangeLog	27 Sep 2005 15:21:40 -0000	1.604
--- libiberty/ChangeLog	27 Sep 2005 17:43:22 -0000
***************
*** 0 ****
--- 1,14 ----
+ 2005-09-27  Terry Laurenzo  <tlaurenzo@gmail.com>
+ 
+ 	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.
+ 
Index: include/ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/include/ChangeLog,v
retrieving revision 1.200
diff -c -0 -r1.200 ChangeLog
*** include/ChangeLog	17 Aug 2005 17:30:47 -0000	1.200
--- include/ChangeLog	27 Sep 2005 17:43:22 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2005-09-27  Terry Laurenzo  <tlaurenzo@gmail.org>
+ 
+ 	PR java/9861
+ 	* demangle.h : Add DMGL_RET_POSTFIX define to enable alternative
+ 	output format for return types
+ 

[-- Attachment #4: pr9861-gcc.diff --]
[-- Type: application/octet-stream, Size: 6990 bytes --]

Index: gcc/cp/mangle.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/mangle.c,v
retrieving revision 1.128
diff -c -3 -p -r1.128 mangle.c
*** gcc/cp/mangle.c	13 Sep 2005 15:15:31 -0000	1.128
--- gcc/cp/mangle.c	27 Sep 2005 17:44:34 -0000
*************** write_function_type (const tree type)
*** 1858,1873 ****
     is mangled before the parameter types.  If non-NULL, DECL is
     FUNCTION_DECL for the function whose type is being emitted.
  
!      <bare-function-type> ::= </signature/ type>+  */
  
  static void
  write_bare_function_type (const tree type, const int include_return_type_p,
  			  const tree decl)
  {
    MANGLE_TRACE_TREE ("bare-function-type", type);
  
    /* Mangle the return type, if requested.  */
!   if (include_return_type_p)
      write_type (TREE_TYPE (type));
  
    /* Now mangle the types of the arguments.  */
--- 1858,1895 ----
     is mangled before the parameter types.  If non-NULL, DECL is
     FUNCTION_DECL for the function whose type is being emitted.
  
!    If DECL is a member of a Java type, then a literal 'J'
!    is output and the return type is mangled as if INCLUDE_RETURN_TYPE
!    were nonzero.
! 
!      <bare-function-type> ::= [J]</signature/ type>+  */
  
  static void
  write_bare_function_type (const tree type, const int include_return_type_p,
  			  const tree decl)
  {
+   int java_method_p;
+ 
    MANGLE_TRACE_TREE ("bare-function-type", type);
  
+   /* Detect Java methods and emit special encoding.  */
+   if (decl != NULL
+       && DECL_FUNCTION_MEMBER_P (decl)
+       && TYPE_FOR_JAVA (DECL_CONTEXT (decl))
+       && !DECL_CONSTRUCTOR_P (decl)
+       && !DECL_DESTRUCTOR_P (decl)
+       && !DECL_CONV_FN_P (decl))
+     {
+       java_method_p = 1;
+       write_char ('J');
+     }
+   else
+     {
+       java_method_p = 0;
+     }
+ 
    /* Mangle the return type, if requested.  */
!   if (include_return_type_p || java_method_p)
      write_type (TREE_TYPE (type));
  
    /* Now mangle the types of the arguments.  */
Index: gcc/java/mangle.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/java/mangle.c,v
retrieving revision 1.34
diff -c -3 -p -r1.34 mangle.c
*** gcc/java/mangle.c	25 Jun 2005 00:33:04 -0000	1.34
--- gcc/java/mangle.c	27 Sep 2005 17:44:34 -0000
*************** mangle_method_decl (tree mdecl)
*** 188,193 ****
--- 188,201 ----
    if (TREE_CODE (TREE_TYPE (mdecl)) == METHOD_TYPE)
      arglist = TREE_CHAIN (arglist);
    
+   /* Output literal 'J' and mangle the return type IF not a 
+      constructor.  */
+   if (!ID_INIT_P (method_name))
+     {
+       obstack_1grow (mangle_obstack, 'J');
+       mangle_type(TREE_TYPE(TREE_TYPE(mdecl)));
+     }
+   
    /* No arguments is easy. We shortcut it. */
    if (arglist == end_params_node)
      obstack_1grow (mangle_obstack, 'v');
Index: gcc/java/builtins.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/java/builtins.c,v
retrieving revision 1.34
diff -c -3 -p -r1.34 builtins.c
*** gcc/java/builtins.c	18 Sep 2005 19:10:10 -0000	1.34
--- gcc/java/builtins.c	27 Sep 2005 17:44:34 -0000
*************** initialize_builtins (void)
*** 194,236 ****
  		  float_ftype_float_float, "fmodf", BUILTIN_CONST);
  
    define_builtin (BUILT_IN_ACOS, "__builtin_acos",
! 		  double_ftype_double, "_ZN4java4lang4Math4acosEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_ASIN, "__builtin_asin",
! 		  double_ftype_double, "_ZN4java4lang4Math4asinEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_ATAN, "__builtin_atan",
! 		  double_ftype_double, "_ZN4java4lang4Math4atanEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_ATAN2, "__builtin_atan2",
! 		  double_ftype_double_double, "_ZN4java4lang4Math5atan2Edd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_CEIL, "__builtin_ceil",
! 		  double_ftype_double, "_ZN4java4lang4Math4ceilEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_COS, "__builtin_cos",
! 		  double_ftype_double, "_ZN4java4lang4Math3cosEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_EXP, "__builtin_exp",
! 		  double_ftype_double, "_ZN4java4lang4Math3expEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_FLOOR, "__builtin_floor",
! 		  double_ftype_double, "_ZN4java4lang4Math5floorEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_LOG, "__builtin_log",
! 		  double_ftype_double, "_ZN4java4lang4Math3logEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_POW, "__builtin_pow",
! 		  double_ftype_double_double, "_ZN4java4lang4Math3powEdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_SIN, "__builtin_sin",
! 		  double_ftype_double, "_ZN4java4lang4Math3sinEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_SQRT, "__builtin_sqrt",
! 		  double_ftype_double, "_ZN4java4lang4Math4sqrtEd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_TAN, "__builtin_tan",
! 		  double_ftype_double, "_ZN4java4lang4Math3tanEd",
  		  BUILTIN_CONST);
    
    t = tree_cons (NULL_TREE, boolean_type_node, end_params_node);
--- 194,236 ----
  		  float_ftype_float_float, "fmodf", BUILTIN_CONST);
  
    define_builtin (BUILT_IN_ACOS, "__builtin_acos",
! 		  double_ftype_double, "_ZN4java4lang4Math4acosEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_ASIN, "__builtin_asin",
! 		  double_ftype_double, "_ZN4java4lang4Math4asinEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_ATAN, "__builtin_atan",
! 		  double_ftype_double, "_ZN4java4lang4Math4atanEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_ATAN2, "__builtin_atan2",
! 		  double_ftype_double_double, "_ZN4java4lang4Math5atan2EJddd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_CEIL, "__builtin_ceil",
! 		  double_ftype_double, "_ZN4java4lang4Math4ceilEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_COS, "__builtin_cos",
! 		  double_ftype_double, "_ZN4java4lang4Math3cosEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_EXP, "__builtin_exp",
! 		  double_ftype_double, "_ZN4java4lang4Math3expEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_FLOOR, "__builtin_floor",
! 		  double_ftype_double, "_ZN4java4lang4Math5floorEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_LOG, "__builtin_log",
! 		  double_ftype_double, "_ZN4java4lang4Math3logEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_POW, "__builtin_pow",
! 		  double_ftype_double_double, "_ZN4java4lang4Math3powEJddd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_SIN, "__builtin_sin",
! 		  double_ftype_double, "_ZN4java4lang4Math3sinEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_SQRT, "__builtin_sqrt",
! 		  double_ftype_double, "_ZN4java4lang4Math4sqrtEJdd",
  		  BUILTIN_CONST);
    define_builtin (BUILT_IN_TAN, "__builtin_tan",
! 		  double_ftype_double, "_ZN4java4lang4Math3tanEJdd",
  		  BUILTIN_CONST);
    
    t = tree_cons (NULL_TREE, boolean_type_node, end_params_node);

[-- Attachment #5: pr9861-gcc-cl.diff --]
[-- Type: application/octet-stream, Size: 1173 bytes --]

Index: gcc/cp/ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/ChangeLog,v
retrieving revision 1.4900
diff -c -0 -r1.4900 ChangeLog
*** gcc/cp/ChangeLog	22 Sep 2005 00:11:18 -0000	1.4900
--- gcc/cp/ChangeLog	27 Sep 2005 17:44:59 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2005-09-23   Terry Laurenzo   <tlaurenzo@gmail.com>
+ 
+ 	PR java/9861
+ 	* mangle.c (write_bare_function_type): Mangle return type for 
+ 	methods of Java classes
+ 
Index: gcc/java/ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/java/ChangeLog,v
retrieving revision 1.1666
diff -c -0 -r1.1666 ChangeLog
*** gcc/java/ChangeLog	21 Sep 2005 13:34:27 -0000	1.1666
--- gcc/java/ChangeLog	27 Sep 2005 17:45:03 -0000
***************
*** 0 ****
--- 1,8 ----
+ 2005-09-23   Terry Laurenzo   <tlaurenzo@gmail.com>
+ 
+ 	PR java/9861
+ 	* mangle.c (mangle_method_decl): Mangle Java methods by prepending 'J'
+ 	to bare_function_type and including the return type
+ 	* builtins.c (initialize_builtins): Change builtin mangled name 
+ 	constants to conform to new mangling scheme
+ 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-09-27 18:27 Patch to fix PR9861 (reprise) TJ Laurenzo
@ 2005-09-27 18:53 ` Andrew Haley
  2005-09-27 20:29 ` Ian Lance Taylor
  2005-09-30 14:40 ` Andrew Haley
  2 siblings, 0 replies; 10+ messages in thread
From: Andrew Haley @ 2005-09-27 18:53 UTC (permalink / raw)
  To: TJ Laurenzo; +Cc: gcc-patches, java-patches

Please resend to 

binutils@sourceware.org
gdb@sources.redhat.com

Andrew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-09-27 18:27 Patch to fix PR9861 (reprise) TJ Laurenzo
  2005-09-27 18:53 ` Andrew Haley
@ 2005-09-27 20:29 ` Ian Lance Taylor
  2005-12-09 12:52   ` Andrew Haley
  2005-09-30 14:40 ` Andrew Haley
  2 siblings, 1 reply; 10+ messages in thread
From: Ian Lance Taylor @ 2005-09-27 20:29 UTC (permalink / raw)
  To: tj; +Cc: gcc-patches, java-patches

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-09-27 18:27 Patch to fix PR9861 (reprise) TJ Laurenzo
  2005-09-27 18:53 ` Andrew Haley
  2005-09-27 20:29 ` Ian Lance Taylor
@ 2005-09-30 14:40 ` Andrew Haley
  2005-09-30 14:43   ` TJ Laurenzo
  2 siblings, 1 reply; 10+ messages in thread
From: Andrew Haley @ 2005-09-30 14:40 UTC (permalink / raw)
  To: TJ Laurenzo; +Cc: gcc-patches, java-patches

TJ Laurenzo 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

This is OK.  As the demangling change has been approved by Ian Taylor,
the compiler patch may now be applied.

Please make sure the demangling patch is made to gdb and binutils.

One thing I havent asked: you do have GNU paperwork, don't you?

Andrew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-09-30 14:40 ` Andrew Haley
@ 2005-09-30 14:43   ` TJ Laurenzo
  2005-09-30 15:06     ` Mark Wielaard
  0 siblings, 1 reply; 10+ messages in thread
From: TJ Laurenzo @ 2005-09-30 14:43 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-patches, java-patches

I sent in the paperwork for GCC and Classpath about a month ago.  I
haven't heard back yet.  Is there someone I need to check with?

On 9/30/05, Andrew Haley <aph@redhat.com> wrote:
> TJ Laurenzo 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
>
> This is OK.  As the demangling change has been approved by Ian Taylor,
> the compiler patch may now be applied.
>
> Please make sure the demangling patch is made to gdb and binutils.
>
> One thing I havent asked: you do have GNU paperwork, don't you?
>
> Andrew.
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-09-30 14:43   ` TJ Laurenzo
@ 2005-09-30 15:06     ` Mark Wielaard
  2005-10-17 14:04       ` Mark Wielaard
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Wielaard @ 2005-09-30 15:06 UTC (permalink / raw)
  To: tj; +Cc: Andrew Haley, gcc-patches, java-patches

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

Hi TJ,

On Fri, 2005-09-30 at 08:42 -0600, TJ Laurenzo wrote:
> I sent in the paperwork for GCC and Classpath about a month ago.  I
> haven't heard back yet.  Is there someone I need to check with?

There were some staffing changes at the FSF recently. I have some other
pending paperwork for GNU Classpath and will be calling the FSF
copyright clerk to check on the status. If you got a FSF gnu.org
tracking number please let me know then I add it to the list of things
to double-check.

Thanks,

Mark

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-09-30 15:06     ` Mark Wielaard
@ 2005-10-17 14:04       ` Mark Wielaard
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Wielaard @ 2005-10-17 14:04 UTC (permalink / raw)
  To: tj; +Cc: Andrew Haley, gcc-patches, java-patches

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Hi,

On Fri, 2005-09-30 at 17:02 +0200, Mark Wielaard wrote:
> On Fri, 2005-09-30 at 08:42 -0600, TJ Laurenzo wrote:
> > I sent in the paperwork for GCC and Classpath about a month ago.  I
> > haven't heard back yet.  Is there someone I need to check with?
> 
> There were some staffing changes at the FSF recently. I have some other
> pending paperwork for GNU Classpath and will be calling the FSF
> copyright clerk to check on the status.

All paperwork is now taken care of. Thanks TJ.
It is probably easiest to send a little message pointing to the
outstanding patches so they can be (re)reviewed and/or committed now.

Cheers,

Mark

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-09-27 20:29 ` Ian Lance Taylor
@ 2005-12-09 12:52   ` Andrew Haley
  2005-12-09 16:03     ` TJ Laurenzo
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Haley @ 2005-12-09 12:52 UTC (permalink / raw)
  To: tj; +Cc: Ian Lance Taylor, gcc-patches, java-patches

This seems to have stalled.

I approved the gcc patch on September 30, and Ian Taylor approved the
libiberty patch.

Is the issue that you (TJ) don't have write access?

Andrew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-12-09 12:52   ` Andrew Haley
@ 2005-12-09 16:03     ` TJ Laurenzo
  2005-12-09 16:39       ` DJ Delorie
  0 siblings, 1 reply; 10+ messages in thread
From: TJ Laurenzo @ 2005-12-09 16:03 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Ian Lance Taylor, gcc-patches, java-patches

I do now have write access but am a bit short on system resources
needed to actually build and run tests on gcc at the moment.  Since
there has been some time lag between when the patch was approved and
now, I want to reverify it.  I'll see if I can't get that done this
weekend.

Ian: Andrew mentioned that you may be able to offer pointers on the
right way to commit changes to the libiberty bits.  Can this just be
commited to gcc, or does it need to be commited in multiple places to
share with all of the projects.  Your help would be appreciated.

TJ

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch to fix PR9861 (reprise)
  2005-12-09 16:03     ` TJ Laurenzo
@ 2005-12-09 16:39       ` DJ Delorie
  0 siblings, 0 replies; 10+ messages in thread
From: DJ Delorie @ 2005-12-09 16:39 UTC (permalink / raw)
  To: tj; +Cc: aph, ian, gcc-patches, java-patches


> Ian: Andrew mentioned that you may be able to offer pointers on the
> right way to commit changes to the libiberty bits.  Can this just be
> commited to gcc, or does it need to be commited in multiple places to
> share with all of the projects.  Your help would be appreciated.

Just commit in gcc; the rest is semi-automatic.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-12-09 16:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-27 18:27 Patch to fix PR9861 (reprise) TJ Laurenzo
2005-09-27 18:53 ` Andrew Haley
2005-09-27 20:29 ` Ian Lance Taylor
2005-12-09 12:52   ` Andrew Haley
2005-12-09 16:03     ` TJ Laurenzo
2005-12-09 16:39       ` DJ Delorie
2005-09-30 14:40 ` Andrew Haley
2005-09-30 14:43   ` TJ Laurenzo
2005-09-30 15:06     ` Mark Wielaard
2005-10-17 14:04       ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).