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]

Kriang's patch, "ported" for 3.0.3: please apply


Mark,

Here's Kriang's patch, ported to the 3_0_branch (actually I just applied
it and then did a cvs diff).  Please apply it; I have confirmed with
Kriang that the odd-looking mangling matches the ABI spec.  I've verified
that there are no new g++ or libstdc++ fails on sparc-sun-solaris2.7.

Joe
--------------------------------------------------------------

2001-11-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	* mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR,
	CONST_CAST_EXPR.
	* operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR.

Index: mangle.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/mangle.c,v
retrieving revision 1.26.4.8
diff -c -r1.26.4.8 mangle.c
*** mangle.c	2001/04/26 08:30:53	1.26.4.8
--- mangle.c	2001/12/02 00:16:34
***************
*** 1817,1834 ****
        /* If it wasn't any of those, recursively expand the expression.  */
        write_string (operator_name_info[(int) code].mangled_name);
  
!       /* Handle pointers-to-members specially.  */
!       if (code == SCOPE_REF)
  	{
  	  write_type (TREE_OPERAND (expr, 0));
  	  if (TREE_CODE (TREE_OPERAND (expr, 1)) == IDENTIFIER_NODE)
  	    write_source_name (TREE_OPERAND (expr, 1));
  	  else
  	    write_encoding (TREE_OPERAND (expr, 1));
  	}
-       else
- 	for (i = 0; i < TREE_CODE_LENGTH (code); ++i)
- 	  write_expression (TREE_OPERAND (expr, i));
      }
  }
  
--- 1817,1848 ----
        /* If it wasn't any of those, recursively expand the expression.  */
        write_string (operator_name_info[(int) code].mangled_name);
  
!       switch (code)
  	{
+ 	case CAST_EXPR:
+ 	  write_type (TREE_TYPE (expr));
+ 	  write_expression (TREE_VALUE (TREE_OPERAND (expr, 0)));
+ 	  break;
+ 
+ 	case STATIC_CAST_EXPR:
+ 	case CONST_CAST_EXPR:
+ 	  write_type (TREE_TYPE (expr));
+ 	  write_expression (TREE_OPERAND (expr, 0));
+ 	  break;
+ 
+ 	/* Handle pointers-to-members specially.  */
+ 	case SCOPE_REF:
  	  write_type (TREE_OPERAND (expr, 0));
  	  if (TREE_CODE (TREE_OPERAND (expr, 1)) == IDENTIFIER_NODE)
  	    write_source_name (TREE_OPERAND (expr, 1));
  	  else
  	    write_encoding (TREE_OPERAND (expr, 1));
+ 	  break;
+ 
+ 	default:
+ 	  for (i = 0; i < TREE_CODE_LENGTH (code); ++i)
+ 	    write_expression (TREE_OPERAND (expr, i));
  	}
      }
  }
  
Index: operators.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/operators.def,v
retrieving revision 1.6.6.1
diff -c -r1.6.6.1 operators.def
*** operators.def	2001/04/04 04:17:06	1.6.6.1
--- operators.def	2001/12/02 00:18:10
***************
*** 102,107 ****
--- 102,110 ----
  
  /* The cast operator.  */
  DEF_SIMPLE_OPERATOR ("", TYPE_EXPR, "cv", 1)
+ DEF_SIMPLE_OPERATOR ("", CAST_EXPR, "cv", 1)
+ DEF_SIMPLE_OPERATOR ("", CONST_CAST_EXPR, "cv", 1)
+ DEF_SIMPLE_OPERATOR ("", STATIC_CAST_EXPR, "cv", 1)
  
  /* Binary operators.  */
  DEF_SIMPLE_OPERATOR ("+", PLUS_EXPR, "pl", 2)


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