ppc va-arg-10 fix

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Wed Oct 6 12:37:00 GMT 1999


Am Die, 05 Okt 1999 schrieb Mark Mitchell:
>>>>>> "Franz" == Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
>
>    Franz> Works fine for me, thanks. What about the make_lang_type_fn
>    Franz> issue? Mind to comment on my questions or do you want to
>    Franz> implement it yourself?
>
>I'd just do:
>
>  tree (*make_lang_type_fn) PROTO((enum tree_code)) = &make_node;
>
>  tree make_lang_type (code)
>    enum tree_code;
>  {
>    return *make_lang_type_fn (code);
>  }
>
>and, in whatever piece of the C++ front-end is called first:
>
>  make_lang_type_fn = cp_make_lang_type;
>
>(renaming make_lang_type to cp_make_lang_type, of course.).

How about the appended stuff? Works fine for me.

Franz.

	* tree.c (make_lang_type_fn): New funtion pointer.
	(make_lang_type): Call it.
	* tree.h (make_lang_type): Declare.
	(make_lang_type_fn): Likewise.
	* rs6000.c (rs6000_build_va_list): Use make_lang_type.

Index: tree.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.c,v
retrieving revision 1.96
diff -u -p -r1.96 tree.c
--- tree.c	1999/10/04 23:57:46	1.96
+++ tree.c	1999/10/06 15:28:22
@@ -1103,6 +1103,15 @@ make_node (code)
 
   return t;
 }
+
+tree (*make_lang_type_fn) PROTO((enum tree_code)) = &make_node;
+
+tree 
+make_lang_type (code)
+     enum tree_code code;
+{
+  return (*make_lang_type_fn) (code);
+}
 
 /* Return a new node with the same contents as NODE except that its
    TREE_CHAIN is zero and it has a fresh uid.  Unlike make_node, this
Index: tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.h,v
retrieving revision 1.95
diff -u -p -r1.95 tree.h
--- tree.h	1999/09/30 13:40:40	1.95
+++ tree.h	1999/10/06 15:28:25
@@ -1560,6 +1560,8 @@ extern char *expralloc			PROTO((int));
    to zero except for a few of the common fields.  */
 
 extern tree make_node			PROTO((enum tree_code));
+extern tree make_lang_type		PROTO((enum tree_code));
+extern tree (*make_lang_type_fn)		PROTO((enum tree_code));
 
 /* Make a copy of a node, with all the same contents except
    for TREE_PERMANENT.  (The copy is permanent
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.102
diff -u -p -r1.102 rs6000.c
--- rs6000.c	1999/10/01 01:46:41	1.102
+++ rs6000.c	1999/10/06 15:28:25
@@ -1782,10 +1787,10 @@ rs6000_build_va_list ()
   if (DEFAULT_ABI != ABI_V4 && DEFAULT_ABI != ABI_SOLARIS)
     return ptr_type_node;
 
-  record = make_node (RECORD_TYPE);
+  record = make_lang_type (RECORD_TYPE);
   type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
   uchar_type_node = make_unsigned_type (CHAR_TYPE_SIZE);
-  
+
   f_gpr = build_decl (FIELD_DECL, get_identifier ("gpr"), uchar_type_node);
   f_fpr = build_decl (FIELD_DECL, get_identifier ("fpr"), uchar_type_node);
   f_ovf = build_decl (FIELD_DECL, get_identifier ("overflow_arg_area"),


	* cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
	* lex.c (cp_make_lake_type): Likewise.
	* tree.c (init_tree): Init make_lang_type_fn.

Index: cp-tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.328
diff -u -p -r1.328 cp-tree.h
--- cp-tree.h	1999/10/04 09:33:29	1.328
+++ cp-tree.h	1999/10/06 13:57:11
@@ -3652,7 +3652,7 @@ extern int is_rid				PROTO((tree));
 extern tree build_lang_decl			PROTO((enum tree_code, tree, tree));
 extern void retrofit_lang_decl			PROTO((tree));
 extern void copy_lang_decl			PROTO((tree));
-extern tree make_lang_type			PROTO((enum tree_code));
+extern tree cp_make_lang_type			PROTO((enum tree_code));
 extern void dump_time_statistics		PROTO((void));
 extern void compiler_error			PVPROTO((const char *, ...))
   ATTRIBUTE_PRINTF_1;
Index: lex.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/lex.c,v
retrieving revision 1.158
diff -u -p -r1.158 lex.c
--- lex.c	1999/10/03 16:04:29	1.158
+++ lex.c	1999/10/06 13:57:12
@@ -4795,7 +4795,7 @@ copy_lang_decl (node)
 }
 
 tree
-make_lang_type (code)
+cp_make_lang_type (code)
      enum tree_code code;
 {
   register tree t = make_node (code);
Index: tree.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/tree.c,v
retrieving revision 1.155
diff -u -p -r1.155 tree.c
--- tree.c	1999/10/03 18:57:12	1.155
+++ tree.c	1999/10/06 13:57:14
@@ -2857,6 +2857,7 @@ mark_list_hash (arg)
 void
 init_tree ()
 {
+  make_lang_type_fn = cp_make_lang_type;
   lang_unsave_expr_now = cplus_unsave_expr_now;
   ggc_add_root (list_hash_table, 
 		sizeof (list_hash_table) / sizeof (struct list_hash *),


More information about the Gcc-patches mailing list