Patchwork use TYPE_STUB_DECL instead of TREE_CHAIN

login
register
mail settings
Submitter Nathan Froyd
Date Oct. 22, 2010, 1:33 a.m.
Message ID <20101022013342.GQ2806@nightcrawler>
Download mbox | patch
Permalink /patch/68791/
State New
Headers show

Comments

Nathan Froyd - Oct. 22, 2010, 1:33 a.m.
As pointed out in:

http://gcc.gnu.org/ml/gcc-patches/2010-09/msg02353.html

we have a nice, explicit substitute for TREE_CHAIN, so let's make the
backends use it.

Tested on x86_64-unknown-linux-gnu.  Committed as obvious.

-Nathan

	* config/alpha/alpha.c (alpha_build_builtin_va_list): Use
	TYPE_STUB_DECL instead of TREE_CHAIN.
	* config/i386/i386.c (ix86_build_builtin_va_list_abi): Likewise.
	* config/rs6000/rs6000.c (rs6000_build_builtin_va_list): Likewise.
	* config/s390/s390.c (s390_build_builtin_va_list): Likewise.
	* config/sh/sh.c (sh_build_builtin_va_list): Likewise.
	* config/spu/spu.c (spu_build_builtin_va_list): Likewise.
	* config/stormy16/stormy16.c (xstormy16_build_builtin_va_list):
	Likewise.
	* config/xtensa/xtensa.c (xtensa_build_builtin_va_list): Likewise.

Patch

diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 29098ae..e5ca7ca 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5887,7 +5887,7 @@  alpha_build_builtin_va_list (void)
   record = (*lang_hooks.types.make_type) (RECORD_TYPE);
   type_decl = build_decl (BUILTINS_LOCATION,
 			  TYPE_DECL, get_identifier ("__va_list_tag"), record);
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
 
   /* C++? SET_IS_AGGR_TYPE (record, 1); */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6668a62..7fcb223 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -7005,7 +7005,7 @@  ix86_build_builtin_va_list_abi (enum calling_abi abi)
   DECL_FIELD_CONTEXT (f_ovf) = record;
   DECL_FIELD_CONTEXT (f_sav) = record;
 
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_gpr;
   DECL_CHAIN (f_gpr) = f_fpr;
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 9469d45..193d58f 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -9215,7 +9215,7 @@  rs6000_build_builtin_va_list (void)
   DECL_FIELD_CONTEXT (f_ovf) = record;
   DECL_FIELD_CONTEXT (f_sav) = record;
 
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_gpr;
   DECL_CHAIN (f_gpr) = f_fpr;
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index be26fbd..985d564 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -8683,7 +8683,7 @@  s390_build_builtin_va_list (void)
   DECL_FIELD_CONTEXT (f_ovf) = record;
   DECL_FIELD_CONTEXT (f_sav) = record;
 
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_gpr;
   DECL_CHAIN (f_gpr) = f_fpr;
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 9850969..ff83c81 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -7807,7 +7807,7 @@  sh_build_builtin_va_list (void)
   DECL_FIELD_CONTEXT (f_next_fp_limit) = record;
   DECL_FIELD_CONTEXT (f_next_stack) = record;
 
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_next_o;
   DECL_CHAIN (f_next_o) = f_next_o_limit;
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 059c651..8a41fd8 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -4114,7 +4114,7 @@  spu_build_builtin_va_list (void)
   DECL_ALIGN (f_skip) = 128;
   DECL_USER_ALIGN (f_skip) = 1;
 
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_args;
   DECL_CHAIN (f_args) = f_skip;
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index c4f1c1b..73f2a91 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1314,7 +1314,7 @@  xstormy16_build_builtin_va_list (void)
   DECL_FIELD_CONTEXT (f_1) = record;
   DECL_FIELD_CONTEXT (f_2) = record;
 
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_1;
   DECL_CHAIN (f_1) = f_2;
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 7b261e3..9d846c5 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -2732,7 +2732,7 @@  xtensa_build_builtin_va_list (void)
   DECL_FIELD_CONTEXT (f_reg) = record;
   DECL_FIELD_CONTEXT (f_ndx) = record;
 
-  TREE_CHAIN (record) = type_decl;
+  TYPE_STUB_DECL (record) = type_decl;
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_stk;
   DECL_CHAIN (f_stk) = f_reg;