No TREE_CST_RTL, step 1

Zack Weinberg zack@codesourcery.com
Mon Apr 7 06:07:00 GMT 2003


The big patch I posted yesterday needs to be done a bit more
incrementally; it's too hard to debug as is.

So here's step one, which just restructures the way 'x' and 'c' class
trees are sized.  This makes it possible to change the struct used for
such a tree without needing to touch anything else.  It was necessary
to add a new langhook so that the C++ and Ada front ends can tell
tree.c the sizes of their additional tree_union members.

I also killed off the SRCLOC tree code which wasn't used for anything;
this meant that the C front end didn't need to define that langhook.

Bootstrapped i686-linux; committed.  Part two should follow tomorrow
morning, and part three a bit later.  (The change to initializer_zerop
properly belongs to part two, but is just as correct at this point.)

zw

        * tree.c (tree_size): For all 'c' and 'x' nodes, look directly
        at the sizes of the relevant structures, rather than relying
        on TREE_CODE_LENGTH.  Call lang_hooks.tree_size to get the
        sizes of any such we don't know about.  Use
        lang_hooks.identifier_size for IDENTIFIER_NODE.

        (initializer_zerop): Use CONSTRUCTOR_ELTS.
        * tree.def: Update commentary.  Make fourth element of
        the definition for all 'c' and 'x' nodes zero.

        * langhooks.h: New hook, tree_size / LANG_HOOKS_TREE_SIZE.
        * langhooks-def.h: Update to match.
        * langhooks.c: New default, lhd_tree_size.

        * c-common.def (SRCLOC): Kill.
        * c-pretty-print.c (pp_c_postfix_expression [case SRCLOC]):
        Remove entirely - was already #if-ed out.

ada:
        * ada-tree.def: Make fourth element for GNAT_LOOP_ID zero.
        * misc.c (gnat_tree_size): New function.
        (LANG_HOOKS_TREE_SIZE): Override.
cp:
        * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero.
        * cp-lang.c (cp_tree_size): New function.
        (LANG_HOOKS_TREE_SIZE): Override.

        * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct
        tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill.
        (union lang_tree_node): Remove common and srcloc members.
        (build_srcloc_here): Don't prototype.
        * decl.c (cp_tree_node_structure): Kill SRCLOC case.
        * pt.c (pending_templates): Correct comment.
        * tree.c (build_srcloc, build_srcloc_here): Kill.

===================================================================
Index: c-common.def
--- c-common.def	29 Sep 2002 13:16:42 -0000	1.13
+++ c-common.def	7 Apr 2003 05:35:25 -0000
@@ -25,9 +25,6 @@ Software Foundation, 59 Temple Place - S
 /* Tree nodes relevant to both C and C++. These were originally in
 cp-tree.def in the cp subdir.  */
 
-/* A node to remember a source position.  */
-DEFTREECODE (SRCLOC, "srcloc", 'x', 2)
-
 DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", '1', 1)
 DEFTREECODE (ARROW_EXPR, "arrow_expr", 'e', 1)
 DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", '1', 1)
===================================================================
Index: c-pretty-print.c
--- c-pretty-print.c	16 Dec 2002 18:19:05 -0000	1.13
+++ c-pretty-print.c	7 Apr 2003 05:35:25 -0000
@@ -718,30 +718,6 @@ pp_c_postfix_expression (ppi, e)
       pp_initializer (ppi, e);
       break;
       
-#if 0
-    case SRCLOC:
-      pp_left_paren (ppi);
-      pp_identifier (ppi, "__location__");
-      pp_right_paren (ppi);
-      pp_whitespace (ppi);
-      pp_left_brace (ppi);
-      pp_dot (ppi);
-      pp_identifier (ppi, "file");
-      pp_whitespace (ppi);
-      pp_equal (ppi);
-      pp_c_whitespace (ppi);
-      pp_c_expression (ppi, SRCLOC_FILE (e));
-      pp_separate_with (ppi, ',');
-      pp_dot (ppi);
-      pp_identifier (ppi, "line");
-      pp_whitespace (ppi);
-      pp_equal (ppi);
-      pp_c_whitespace (ppi);
-      pp_c_expression (ppi, SRCLOC_LINE (e));
-      pp_right_brace (ppi);
-      break;
-#endif
-
     case VA_ARG_EXPR:
       pp_c_identifier (ppi, "__builtin_va_arg");
       pp_c_left_paren (ppi);
===================================================================
Index: langhooks-def.h
--- langhooks-def.h	19 Mar 2003 20:34:01 -0000	1.46
+++ langhooks-def.h	7 Apr 2003 05:35:25 -0000
@@ -65,6 +65,7 @@ extern bool lhd_warn_unused_global_decl 
 extern void lhd_incomplete_type_error PARAMS ((tree, tree));
 extern tree lhd_type_promotes_to PARAMS ((tree));
 extern tree lhd_expr_size PARAMS ((tree));
+extern size_t lhd_tree_size PARAMS ((enum tree_code));
 
 /* Declarations of default tree inlining hooks.  */
 tree lhd_tree_inlining_walk_subtrees		PARAMS ((tree *, int *,
@@ -116,6 +117,7 @@ void write_global_declarations PARAMS ((
 #define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function
 #define LANG_HOOKS_DECL_PRINTABLE_NAME	lhd_decl_printable_name
 #define LANG_HOOKS_EXPR_SIZE		lhd_expr_size
+#define LANG_HOOKS_TREE_SIZE		lhd_tree_size
 
 #define LANG_HOOKS_FUNCTION_INIT	lhd_do_nothing_f
 #define LANG_HOOKS_FUNCTION_FINAL	lhd_do_nothing_f
@@ -238,6 +240,7 @@ int lhd_tree_dump_type_quals			PARAMS ((
 #define LANG_HOOKS_INITIALIZER { \
   LANG_HOOKS_NAME, \
   LANG_HOOKS_IDENTIFIER_SIZE, \
+  LANG_HOOKS_TREE_SIZE, \
   LANG_HOOKS_INIT_OPTIONS, \
   LANG_HOOKS_DECODE_OPTION, \
   LANG_HOOKS_POST_OPTIONS, \
===================================================================
Index: langhooks.c
--- langhooks.c	19 Mar 2003 20:34:01 -0000	1.40
+++ langhooks.c	7 Apr 2003 05:35:25 -0000
@@ -458,6 +458,17 @@ lhd_expr_size (exp)
     return size_in_bytes (TREE_TYPE (exp));
 }
 
+/* lang_hooks.tree_size: Determine the size of a tree with code C,
+   which is a language-specific tree code in category 'x'.  The
+   default expects never to be called.  */
+size_t
+lhd_tree_size (c)
+     enum tree_code c ATTRIBUTE_UNUSED;
+{
+  abort ();
+  return 0;
+}
+
 /* lang_hooks.decls.final_write_globals: perform final processing on
    global variables.  */
 void
===================================================================
Index: langhooks.h
--- langhooks.h	19 Mar 2003 20:34:01 -0000	1.54
+++ langhooks.h	7 Apr 2003 05:35:25 -0000
@@ -193,6 +193,11 @@ struct lang_hooks
      identifier nodes long enough for the language-specific slots.  */
   size_t identifier_size;
 
+  /* Determines the size of any language-specific 'x' or 'c' nodes.
+     Since it is called from make_node, the only information available
+     is the tree code.  Expected to abort on unrecognized codes.  */
+  size_t (*tree_size) PARAMS ((enum tree_code));
+
   /* The first callback made to the front end, for simple
      initialization needed before any calls to decode_option.  */
   void (*init_options) PARAMS ((void));
===================================================================
Index: tree.c
--- tree.c	6 Apr 2003 21:44:09 -0000	1.292
+++ tree.c	7 Apr 2003 05:35:27 -0000
@@ -182,28 +182,32 @@ tree_size (node)
 	      + TREE_CODE_LENGTH (code) * sizeof (char *) - sizeof (char *));
 
     case 'c':  /* a constant */
-      /* We can't use TREE_CODE_LENGTH for INTEGER_CST, since the number of
-	 words is machine-dependent due to varying length of HOST_WIDE_INT,
-	 which might be wider than a pointer (e.g., long long).  Similarly
-	 for REAL_CST, since the number of words is machine-dependent due
-	 to varying size and alignment of `double'.  */
-      if (code == INTEGER_CST)
-	return sizeof (struct tree_int_cst);
-      else if (code == REAL_CST)
-	return sizeof (struct tree_real_cst);
-      else
-	return (sizeof (struct tree_common)
-		+ TREE_CODE_LENGTH (code) * sizeof (char *));
+      switch (code)
+	{
+	case INTEGER_CST:	return sizeof (struct tree_int_cst);
+	case REAL_CST:		return sizeof (struct tree_real_cst);
+	case COMPLEX_CST:	return sizeof (struct tree_complex);
+	case VECTOR_CST:	return sizeof (struct tree_vector);
+	case STRING_CST:	return sizeof (struct tree_string);
+	default:
+	  return (*lang_hooks.tree_size) (code);
+	}
 
     case 'x':  /* something random, like an identifier.  */
-      {
-	size_t length;
-	length = (sizeof (struct tree_common)
-		  + TREE_CODE_LENGTH (code) * sizeof (char *));
-	if (code == TREE_VEC)
-	  length += TREE_VEC_LENGTH (node) * sizeof (char *) - sizeof (char *);
-	return length;
-      }
+      switch (code)
+	{
+	case IDENTIFIER_NODE:	return lang_hooks.identifier_size;
+	case TREE_LIST:		return sizeof (struct tree_list);
+	case TREE_VEC:		return (sizeof (struct tree_vec)
+					+ TREE_VEC_LENGTH(node) * sizeof(char *)
+					- sizeof (char *));
+
+	case ERROR_MARK:
+	case PLACEHOLDER_EXPR:	return sizeof (struct tree_common);
+
+	default:
+	  return (*lang_hooks.tree_size) (code);
+	}
 
     default:
       abort ();
@@ -4817,7 +4821,7 @@ initializer_zerop (init)
       {
 	if (AGGREGATE_TYPE_P (TREE_TYPE (init)))
 	  {
-	    tree aggr_init = TREE_OPERAND (init, 1);
+	    tree aggr_init = CONSTRUCTOR_ELTS (init);
 
 	    while (aggr_init)
 	      {
===================================================================
Index: tree.def
--- tree.def	1 Feb 2003 18:59:48 -0000	1.56
+++ tree.def	7 Apr 2003 05:35:27 -0000
@@ -34,9 +34,13 @@ Software Foundation, 59 Temple Place - S
    's' for codes for expressions with inherent side effects.
    'e' for codes for other kinds of expressions.  */
 
-/* For `r', `e', `<', `1', `2', `s' and `x' nodes,
-   the 4th element is the number of argument slots to allocate.
-   This determines the size of the tree node object.  */
+/* For `r', `e', `<', `1', `2', and `s' nodes, which use struct
+   tree_exp, the 4th element is the number of argument slots to
+   allocate.  This determines the size of the tree node object.
+   Other nodes use different structures, and the size is determined
+   by the tree_union member structure; the 4th element should be
+   zero.  Languages that define language-specific 'x' or 'c' codes
+   must define the tree_size langhook to say how big they are.  */
 
 /* Any erroneous construct is parsed into a node of this type.
    This type of node is accepted without complaint in all contexts
@@ -49,17 +53,17 @@ DEFTREECODE (ERROR_MARK, "error_mark", '
    Internally it looks like a STRING_CST node.
    There is only one IDENTIFIER_NODE ever made for any particular name.
    Use `get_identifier' to get it (or create it, the first time).  */
-DEFTREECODE (IDENTIFIER_NODE, "identifier_node", 'x', ((LANG_HOOKS_IDENTIFIER_SIZE - sizeof (struct tree_common) + sizeof (tree) - 1) / sizeof (tree)))
+DEFTREECODE (IDENTIFIER_NODE, "identifier_node", 'x', 0)
 
 /* 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
    TREE_VALUE fields, while TREE_PURPOSE fields are occasionally
    used as well to get the effect of Lisp association lists.  */
-DEFTREECODE (TREE_LIST, "tree_list", 'x', 2)
+DEFTREECODE (TREE_LIST, "tree_list", 'x', 0)
 
 /* These nodes contain an array of tree nodes.  */
-DEFTREECODE (TREE_VEC, "tree_vec", 'x', 2)
+DEFTREECODE (TREE_VEC, "tree_vec", 'x', 0)
 
 /* A symbol binding block.  These are arranged in a tree,
    where the BLOCK_SUBBLOCKS field contains a chain of subblocks
@@ -257,22 +261,20 @@ DEFTREECODE (LANG_TYPE, "lang_type", 't'
    Note: constants of type char in Pascal are INTEGER_CST,
    and so are pointer constants such as nil in Pascal or NULL in C.
    `(int *) 1' in C also results in an INTEGER_CST.  */
-DEFTREECODE (INTEGER_CST, "integer_cst", 'c', 2)
+DEFTREECODE (INTEGER_CST, "integer_cst", 'c', 0)
 
-/* Contents are in TREE_REAL_CST field.  Also there is TREE_CST_RTL.  */
-DEFTREECODE (REAL_CST, "real_cst", 'c', 3)
+/* Contents are in TREE_REAL_CST field.  */
+DEFTREECODE (REAL_CST, "real_cst", 'c', 0)
 
 /* Contents are in TREE_REALPART and TREE_IMAGPART fields,
-   whose contents are other constant nodes.
-   Also there is TREE_CST_RTL.  */
-DEFTREECODE (COMPLEX_CST, "complex_cst", 'c', 3)
+   whose contents are other constant nodes.  */
+DEFTREECODE (COMPLEX_CST, "complex_cst", 'c', 0)
 
 /* Contents are in TREE_VECTOR_CST_ELTS field.  */
-DEFTREECODE (VECTOR_CST, "vector_cst", 'c', 3)     
+DEFTREECODE (VECTOR_CST, "vector_cst", 'c', 0)     
 
-/* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields.
-   Also there is TREE_CST_RTL.  */
-DEFTREECODE (STRING_CST, "string_cst", 'c', 3)
+/* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields. */
+DEFTREECODE (STRING_CST, "string_cst", 'c', 0)
 
 /* Declarations.  All references to names are represented as ..._DECL nodes.
    The decls in one binding context are chained through the TREE_CHAIN field.
===================================================================
Index: ada/ada-tree.def
--- ada/ada-tree.def	23 Oct 2002 07:33:22 -0000	1.4
+++ ada/ada-tree.def	7 Apr 2003 05:35:27 -0000
@@ -77,4 +77,4 @@ DEFTREECODE (GNAT_NOP_EXPR, "gnat_nop_ex
 
    ??? This should be redone at some point.  */
 
-DEFTREECODE (GNAT_LOOP_ID, "gnat_loop_id", 'x', 1)
+DEFTREECODE (GNAT_LOOP_ID, "gnat_loop_id", 'x', 0)
===================================================================
Index: ada/misc.c
--- ada/misc.c	3 Apr 2003 18:23:04 -0000	1.47
+++ ada/misc.c	7 Apr 2003 05:35:28 -0000
@@ -79,6 +79,7 @@ extern FILE *asm_out_file;
 extern int save_argc;
 extern char **save_argv;
 
+static size_t gnat_tree_size		PARAMS ((enum tree_code));
 static bool gnat_init			PARAMS ((void));
 static void gnat_init_options		PARAMS ((void));
 static int gnat_decode_option		PARAMS ((int, char **));
@@ -98,6 +99,8 @@ static rtx gnat_expand_expr		PARAMS ((tr
 #define LANG_HOOKS_NAME			"GNU Ada"
 #undef  LANG_HOOKS_IDENTIFIER_SIZE
 #define LANG_HOOKS_IDENTIFIER_SIZE	sizeof (struct tree_identifier)
+#undef  LANG_HOOKS_TREE_SIZE
+#define LANG_HOOKS_TREE_SIZE		gnat_tree_size
 #undef  LANG_HOOKS_INIT
 #define LANG_HOOKS_INIT			gnat_init
 #undef  LANG_HOOKS_INIT_OPTIONS
@@ -333,6 +336,19 @@ internal_error_function (msgid, ap)
 
   Current_Error_Node = error_gnat_node;
   Compiler_Abort (fp, -1);
+}
+
+/* Langhook for tree_size: determine size of our 'x' and 'c' nodes.  */
+static size_t
+gnat_tree_size (enum tree_code code)
+{
+  switch (code)
+    {
+    case GNAT_LOOP_ID:	return sizeof (struct tree_loop_id);
+    default:
+      abort ();
+    }
+  /* NOTREACHED */
 }
 
 /* Perform all the initialization steps that are language-specific.  */
===================================================================
Index: cp/cp-lang.c
--- cp/cp-lang.c	10 Mar 2003 07:26:33 -0000	1.48
+++ cp/cp-lang.c	7 Apr 2003 05:35:28 -0000
@@ -34,10 +34,13 @@ static HOST_WIDE_INT cxx_get_alias_set (
 static bool ok_to_generate_alias_set_for_type (tree);
 static bool cxx_warn_unused_global_decl (tree);
 static tree cp_expr_size (tree);
+static size_t cp_tree_size (enum tree_code);
 static bool cp_var_mod_type_p (tree);
 
 #undef LANG_HOOKS_NAME
 #define LANG_HOOKS_NAME "GNU C++"
+#undef LANG_HOOKS_TREE_SIZE
+#define LANG_HOOKS_TREE_SIZE cp_tree_size
 #undef LANG_HOOKS_INIT
 #define LANG_HOOKS_INIT cxx_init
 #undef LANG_HOOKS_FINISH
@@ -316,6 +319,24 @@ cp_expr_size (tree exp)
   else
     /* Use the default code.  */
     return lhd_expr_size (exp);
+}
+
+/* Langhook for tree_size: determine size of our 'x' and 'c' nodes.  */
+static size_t
+cp_tree_size (enum tree_code code)
+{
+  switch (code)
+    {
+    case PTRMEM_CST: 		return sizeof (struct ptrmem_cst);
+    case BASELINK:		return sizeof (struct tree_baselink);
+    case TEMPLATE_PARM_INDEX: 	return sizeof (template_parm_index);
+    case DEFAULT_ARG:		return sizeof (struct tree_default_arg);
+    case OVERLOAD:		return sizeof (struct tree_overload);
+    case WRAPPER:		return sizeof (struct tree_wrapper);
+    default:
+      abort ();
+    }
+  /* NOTREACHED */
 }
 
 /* Returns true if T is a variably modified type, in the sense of C99.
===================================================================
Index: cp/cp-tree.def
--- cp/cp-tree.def	15 Mar 2003 16:30:01 -0000	1.72
+++ cp/cp-tree.def	7 Apr 2003 05:35:28 -0000
@@ -47,7 +47,7 @@ DEFTREECODE (OFFSET_REF, "offset_ref", '
 /* A pointer-to-member constant.  For a pointer-to-member constant
    `X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X' and the
    PTRMEM_CST_MEMBER is the _DECL for `Y'.  */
-DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 2)
+DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 0)
 
 /* For NEW_EXPR, operand 0 is the placement list.
    Operand 1 is the new-declarator.
@@ -105,7 +105,7 @@ DEFTREECODE (ALIAS_DECL, "alias_decl", '
    the type of the expression.  This type is either a FUNCTION_TYPE,
    METHOD_TYPE, or `unknown_type_node' indicating that the function is
    overloaded. */
-DEFTREECODE (BASELINK, "baselink", 'x', 3)
+DEFTREECODE (BASELINK, "baselink", 'x', 0)
 
 /* Template definition.  The following fields have the specified uses,
    although there are other macros in cp-tree.h that should be used for
@@ -157,16 +157,7 @@ DEFTREECODE (TEMPLATE_DECL, "template_de
    The LEVEL is the level of the parameter when we are worrying about
    the types of things; the ORIG_LEVEL is the level when we are
    worrying about instantiating things.  */
-DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x', 
-	     /* The addition of (sizeof(tree) - 1) in the next expression
-		is to handle the case when padding pushes us past an even
-		multiple of sizeof(tree).  */
-	     /* We used to try to calculate this using
-		1+3*sizeof(HOST_WIDE_INT), but that fails if alignment
-		makes it bigger.  */
-	     ((sizeof (template_parm_index) - sizeof (struct tree_common))
-	      + sizeof (tree) - 1)
-	     / sizeof (tree))
+DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x', 0)
 
 /* Index into a template parameter list.  This parameter must be a type.
    The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX.  */
@@ -212,7 +203,7 @@ DEFTREECODE (USING_DECL, "using_decl", '
 DEFTREECODE (USING_STMT, "using_directive", 'e', 1)
 
 /* An un-parsed default argument.  Looks like an IDENTIFIER_NODE.  */
-DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 2)
+DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 0)
 
 /* A template-id, like foo<int>.  The first operand is the template.
    The second is the TREE_LIST or TREE_VEC of explicitly specified
@@ -224,11 +215,11 @@ DEFTREECODE (TEMPLATE_ID_EXPR, "template
 
 /* A list-like node for chaining overloading candidates. TREE_TYPE is 
    the original name, and the parameter is the FUNCTION_DECL.  */
-DEFTREECODE (OVERLOAD, "overload", 'x', 1)
+DEFTREECODE (OVERLOAD, "overload", 'x', 0)
 
 /* A generic wrapper for something not tree that we want to include in
    tree structure.  */
-DEFTREECODE (WRAPPER, "wrapper", 'x', 1)
+DEFTREECODE (WRAPPER, "wrapper", 'x', 0)
 
 /* Used to represent deferred name lookup for dependent names while
    parsing a template declaration.  The first argument is an
===================================================================
Index: cp/cp-tree.h
--- cp/cp-tree.h	3 Apr 2003 23:26:03 -0000	1.835
+++ cp/cp-tree.h	7 Apr 2003 05:35:30 -0000
@@ -353,17 +353,6 @@ struct tree_wrapper GTY(())
   struct z_candidate *z_c;
 };
 
-#define SOURCE_LOCUS(NODE) \
-   (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->locus)
-#define SRCLOC_FILE(NODE) SOURCE_LOCUS (NODE).file
-#define SRCLOC_LINE(NODE) SOURCE_LOCUS (NODE).line
-
-struct tree_srcloc GTY(())
-{
-  struct tree_common common;
-  location_t locus;
-};
-
 /* Macros for access to language-specific slots in an identifier.  */
 
 #define IDENTIFIER_NAMESPACE_BINDINGS(NODE)	\
@@ -466,7 +455,6 @@ struct tree_default_arg GTY (())
 };
 
 enum cp_tree_node_structure_enum {
-  TS_CP_COMMON,
   TS_CP_GENERIC,
   TS_CP_IDENTIFIER,
   TS_CP_TPI,
@@ -475,7 +463,6 @@ enum cp_tree_node_structure_enum {
   TS_CP_OVERLOAD,
   TS_CP_BASELINK,
   TS_CP_WRAPPER,
-  TS_CP_SRCLOC,
   TS_CP_DEFAULT_ARG,
   LAST_TS_CP_ENUM
 };
@@ -484,7 +471,6 @@ enum cp_tree_node_structure_enum {
 union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"),
        chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
 {
-  struct tree_common GTY ((tag ("TS_CP_COMMON"))) common;
   union tree_node GTY ((tag ("TS_CP_GENERIC"),
 			desc ("tree_node_structure (&%h)"))) generic;
   struct template_parm_index_s GTY ((tag ("TS_CP_TPI"))) tpi;
@@ -492,7 +478,6 @@ union lang_tree_node GTY((desc ("cp_tree
   struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload;
   struct tree_baselink GTY ((tag ("TS_CP_BASELINK"))) baselink;
   struct tree_wrapper GTY ((tag ("TS_CP_WRAPPER"))) wrapper;
-  struct tree_srcloc GTY ((tag ("TS_CP_SRCLOC"))) srcloc;
   struct tree_default_arg GTY ((tag ("TS_CP_DEFAULT_ARG"))) default_arg;
   struct lang_identifier GTY ((tag ("TS_CP_IDENTIFIER"))) identifier;
 };
@@ -4212,7 +4197,6 @@ extern tree decl_namespace_context		(tre
 extern tree lvalue_type				(tree);
 extern tree error_type				(tree);
 extern tree build_zc_wrapper			(struct z_candidate *);
-extern tree build_srcloc_here			(void);
 extern int varargs_function_p			(tree);
 extern int really_overloaded_fn			(tree);
 extern int cp_tree_equal			(tree, tree);
===================================================================
Index: cp/decl.c
--- cp/decl.c	5 Apr 2003 16:48:31 -0000	1.1032
+++ cp/decl.c	7 Apr 2003 05:35:35 -0000
@@ -14405,7 +14405,6 @@ cp_tree_node_structure (union lang_tree_
     case PTRMEM_CST:		return TS_CP_PTRMEM;
     case BASELINK:              return TS_CP_BASELINK;
     case WRAPPER:		return TS_CP_WRAPPER;
-    case SRCLOC:		return TS_CP_SRCLOC;
     default:			return TS_CP_GENERIC;
     }
 }
===================================================================
Index: cp/pt.c
--- cp/pt.c	27 Mar 2003 14:04:26 -0000	1.677
+++ cp/pt.c	7 Apr 2003 05:35:38 -0000
@@ -49,11 +49,10 @@ typedef int (*tree_fn_t) PARAMS ((tree, 
 
 /* The PENDING_TEMPLATES is a TREE_LIST of templates whose
    instantiations have been deferred, either because their definitions
-   were not yet available, or because we were putting off doing the
-   work.  The TREE_PURPOSE of each entry is a SRCLOC indicating where
-   the instantiate request occurred; the TREE_VALUE is either a DECL
-   (for a function or static data member), or a TYPE (for a class)
-   indicating what we are hoping to instantiate.  */
+   were not yet available, or because we were putting off doing the work.
+   The TREE_PURPOSE of each entry is either a DECL (for a function or
+   static data member), or a TYPE (for a class) indicating what we are
+   hoping to instantiate.  The TREE_VALUE is not used.  */
 static GTY(()) tree pending_templates;
 static GTY(()) tree last_pending_template;
 
===================================================================
Index: cp/tree.c
--- cp/tree.c	15 Mar 2003 13:43:31 -0000	1.320
+++ cp/tree.c	7 Apr 2003 05:35:39 -0000
@@ -43,7 +43,6 @@ static hashval_t list_hash_pieces PARAMS
 static hashval_t list_hash PARAMS ((const void *));
 static cp_lvalue_kind lvalue_p_1 PARAMS ((tree, int, int));
 static tree no_linkage_helper PARAMS ((tree *, int *, void *));
-static tree build_srcloc PARAMS ((const char *, int));
 static tree mark_local_for_remap_r PARAMS ((tree *, int *, void *));
 static tree cp_unsave_r PARAMS ((tree *, int *, void *));
 static tree build_target_expr PARAMS ((tree, tree));
@@ -1822,26 +1821,6 @@ build_zc_wrapper (ptr)
   tree t = make_node (WRAPPER);
   WRAPPER_ZC (t) = ptr;
   return t;
-}
-
-static tree
-build_srcloc (file, line)
-     const char *file;
-     int line;
-{
-  tree t;
-
-  t = make_node (SRCLOC);
-  SRCLOC_FILE (t) = file;
-  SRCLOC_LINE (t) = line;
-
-  return t;
-}
-
-tree
-build_srcloc_here ()
-{
-  return build_srcloc (input_filename, lineno);
 }
 
 /* The type of ARG when used as an lvalue.  */



More information about the Gcc-patches mailing list