diff mbox

make CONST_DECL a direct subclass of tree_decl_common

Message ID 20110401190142.GU23480@codesourcery.com
State New
Headers show

Commit Message

Nathan Froyd April 1, 2011, 7:01 p.m. UTC
Nobody touches CONST_DECL's DECL_RTL, so there's no reason to for
CONST_DECL to inherit from tree_decl_with_rtl.  This patch adjusts the
inheritance structure accordingly.

Bootstrapped on x86_64-unknown-linux-gnu; tests in progress.  OK to
commit once those complete?

-Nathan

	* tree.h (struct tree_const_decl): Inherit from tree_decl_common.
	* tree.c (initialize_tree_contains_struct): Adjust accordingly.

Comments

Richard Biener April 2, 2011, 7:49 a.m. UTC | #1
On Fri, Apr 1, 2011 at 9:01 PM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> Nobody touches CONST_DECL's DECL_RTL, so there's no reason to for
> CONST_DECL to inherit from tree_decl_with_rtl.  This patch adjusts the
> inheritance structure accordingly.
>
> Bootstrapped on x86_64-unknown-linux-gnu; tests in progress.  OK to
> commit once those complete?

Ok.

Thanks,
Richard.

> -Nathan
>
>        * tree.h (struct tree_const_decl): Inherit from tree_decl_common.
>        * tree.c (initialize_tree_contains_struct): Adjust accordingly.
>
> diff --git a/gcc/tree.c b/gcc/tree.c
> index 69d5ecb..3d8abee 100644
> --- a/gcc/tree.c
> +++ b/gcc/tree.c
> @@ -439,6 +439,7 @@ initialize_tree_contains_struct (void)
>          break;
>
>        case TS_DECL_WRTL:
> +       case TS_CONST_DECL:
>          MARK_TS_DECL_COMMON (code);
>          break;
>
> @@ -450,7 +451,6 @@ initialize_tree_contains_struct (void)
>        case TS_PARM_DECL:
>        case TS_LABEL_DECL:
>        case TS_RESULT_DECL:
> -       case TS_CONST_DECL:
>          MARK_TS_DECL_WRTL (code);
>          break;
>
> @@ -488,7 +488,6 @@ initialize_tree_contains_struct (void)
>   gcc_assert (tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_COMMON]);
>   gcc_assert (tree_contains_struct[LABEL_DECL][TS_DECL_COMMON]);
>   gcc_assert (tree_contains_struct[FIELD_DECL][TS_DECL_COMMON]);
> -  gcc_assert (tree_contains_struct[CONST_DECL][TS_DECL_WRTL]);
>   gcc_assert (tree_contains_struct[VAR_DECL][TS_DECL_WRTL]);
>   gcc_assert (tree_contains_struct[PARM_DECL][TS_DECL_WRTL]);
>   gcc_assert (tree_contains_struct[RESULT_DECL][TS_DECL_WRTL]);
> diff --git a/gcc/tree.h b/gcc/tree.h
> index 9a288cb..e166ae3 100644
> --- a/gcc/tree.h
> +++ b/gcc/tree.h
> @@ -2962,7 +2962,7 @@ struct GTY(()) tree_result_decl {
>  };
>
>  struct GTY(()) tree_const_decl {
> -  struct tree_decl_with_rtl common;
> +  struct tree_decl_common common;
>  };
>
>  /* For a PARM_DECL, records the data type used to pass the argument,
>
diff mbox

Patch

diff --git a/gcc/tree.c b/gcc/tree.c
index 69d5ecb..3d8abee 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -439,6 +439,7 @@  initialize_tree_contains_struct (void)
 	  break;
 
 	case TS_DECL_WRTL:
+	case TS_CONST_DECL:
 	  MARK_TS_DECL_COMMON (code);
 	  break;
 
@@ -450,7 +451,6 @@  initialize_tree_contains_struct (void)
 	case TS_PARM_DECL:
 	case TS_LABEL_DECL:
 	case TS_RESULT_DECL:
-	case TS_CONST_DECL:
 	  MARK_TS_DECL_WRTL (code);
 	  break;
 
@@ -488,7 +488,6 @@  initialize_tree_contains_struct (void)
   gcc_assert (tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_COMMON]);
   gcc_assert (tree_contains_struct[LABEL_DECL][TS_DECL_COMMON]);
   gcc_assert (tree_contains_struct[FIELD_DECL][TS_DECL_COMMON]);
-  gcc_assert (tree_contains_struct[CONST_DECL][TS_DECL_WRTL]);
   gcc_assert (tree_contains_struct[VAR_DECL][TS_DECL_WRTL]);
   gcc_assert (tree_contains_struct[PARM_DECL][TS_DECL_WRTL]);
   gcc_assert (tree_contains_struct[RESULT_DECL][TS_DECL_WRTL]);
diff --git a/gcc/tree.h b/gcc/tree.h
index 9a288cb..e166ae3 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2962,7 +2962,7 @@  struct GTY(()) tree_result_decl {
 };
 
 struct GTY(()) tree_const_decl {
-  struct tree_decl_with_rtl common;
+  struct tree_decl_common common;
 };
 
 /* For a PARM_DECL, records the data type used to pass the argument,