PATCH: Remove OP_IDENTIFIER tree node type

Ira Ruben ira@apple.com
Mon Jun 25 17:52:00 GMT 2001


There is only one place that an OP_IDENTIFIER tree node is created.
It is build_op_identifier() in tree.c and it is #if'0'ed out.  If
there is no reason to keep this code I propose that we remove the
OP_IDENTIFIER tree type.  Here's a patch to do that.

2001-06-25  Ira Ruben	<ira@apple.com>

	Remove OP_IDENTIFIER.
	* print-tree.c (print_node): Remove OP_IDENTIFIER case.
	* tree.c (tree_node_kind enum): Remove op_id_kind.
	(tree_node_kind_names): Remove "op_identifiers".
	(make_node): Remove OP_IDENTIFIER test.
	(build_op_identifier): Removed because it isn't being used.
	* tree.def (OP_IDENTIFIER): Remove.
	* cp/pt.c (tsubst): Remove OP_IDENTIFIER case.

Index: print-tree.c
===================================================================
RCS file: /cvs/repository/CoreTools/gcc3/gcc/print-tree.c,v
retrieving revision 1.5
diff -c -3 -p -r1.5 print-tree.c
*** print-tree.c	2001/06/05 22:15:22	1.5
--- print-tree.c	2001/06/25 19:12:29
*************** print_node (file, prefix, node, indent)
*** 755,765 ****
   	      }
   	  break;

- 	case OP_IDENTIFIER:
- 	  print_node (file, "op1", TREE_PURPOSE (node), indent + 4);
- 	  print_node (file, "op2", TREE_VALUE (node), indent + 4);
- 	  break;
-
   	default:
   	  if (TREE_CODE_CLASS (TREE_CODE (node)) == 'x')
   	    lang_print_xnode (file, node, indent);
--- 755,760 ----
Index: tree.c
===================================================================
RCS file: /cvs/repository/CoreTools/gcc3/gcc/tree.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 tree.c
*** tree.c	2001/06/05 22:15:23	1.4
--- tree.c	2001/06/25 19:12:29
*************** typedef enum
*** 98,104 ****
     e_kind,
     c_kind,
     id_kind,
-   op_id_kind,
     perm_list_kind,
     temp_list_kind,
     vec_kind,
--- 98,103 ----
*************** static const char * const tree_node_kind
*** 121,127 ****
     "exprs",
     "constants",
     "identifiers",
-   "op_identifiers",
     "perm_tree_lists",
     "temp_tree_lists",
     "vecs",
--- 120,125 ----
*************** make_node (code)
*** 383,390 ****
       case 'x':  /* something random, like an identifier.  */
         if (code == IDENTIFIER_NODE)
   	kind = id_kind;
-       else if (code == OP_IDENTIFIER)
- 	kind = op_id_kind;
         else if (code == TREE_VEC)
   	kind = vec_kind;
         else
--- 381,386 ----
*************** build_nt VPARAMS ((enum tree_code code,
*** 2569,2588 ****
     va_end (p);
     return t;
   }
-
- #if 0
- /* Commented out because this wants to be done very
-    differently.  See cp-lex.c.  */
- tree
- build_op_identifier (op1, op2)
-      tree op1, op2;
- {
-   register tree t = make_node (OP_IDENTIFIER);
-   TREE_PURPOSE (t) = op1;
-   TREE_VALUE (t) = op2;
-   return t;
- }
- #endif
   
   /* Create a DECL_... node of code CODE, name NAME and data type TYPE.
      We do NOT enter this node in any sort of symbol table.
--- 2565,2570 ----
Index: tree.def
===================================================================
RCS file: /cvs/repository/CoreTools/gcc3/gcc/tree.def,v
retrieving revision 1.4
diff -c -3 -p -r1.4 tree.def
*** tree.def	2001/06/14 22:14:23	1.4
--- tree.def	2001/06/25 19:12:29
*************** DEFTREECODE (ERROR_MARK, "error_mark", '
*** 51,61 ****
      Use `get_identifier' to get it (or create it, the first time).  */
   DEFTREECODE (IDENTIFIER_NODE, "identifier_node", 'x', -1)

- /* Used to hold information to identify an operator (or combination
-    of two operators) considered as a `noun' rather than a `verb'.
-    The first operand is encoded in the TREE_TYPE field.  */
- DEFTREECODE (OP_IDENTIFIER, "op_identifier", 'x', 2)
-
   /* Has the TREE_VALUE and TREE_PURPOSE fields.  */
   /* These nodes are made into lists by chaining through the
      TREE_CHAIN field.  The elements of the list live in the
--- 51,56 ----
Index: cp/pt.c
===================================================================
RCS file: /cvs/repository/CoreTools/gcc3/gcc/cp/pt.c,v
retrieving revision 1.1.1.16
diff -c -3 -p -r1.1.1.16 pt.c
*** pt.c	2001/06/21 18:01:12	1.1.1.16
--- pt.c	2001/06/25 19:12:32
*************** tsubst (t, args, complain, in_decl)
*** 6248,6254 ****

       case ERROR_MARK:
       case IDENTIFIER_NODE:
-     case OP_IDENTIFIER:
       case VOID_TYPE:
       case REAL_TYPE:
       case COMPLEX_TYPE:
--- 6248,6253 ----



More information about the Gcc-patches mailing list