From f6bad6ff73b4581bd92c2a723c7217ef9d990660 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 14 May 1994 01:56:51 +0000 Subject: [PATCH] (integrate_decl_tree): Use copy_node to make a copy of the decl. (integrate_decl_tree): Use copy_node to make a copy of the decl. Also call copy_lang_decl to copy the language-specific bits. From-SVN: r7296 --- gcc/integrate.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/gcc/integrate.c b/gcc/integrate.c index e0b6f7a4d01..0d03ba85812 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -1925,9 +1925,13 @@ integrate_decl_tree (let, level, map) for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t)) { - tree d = build_decl (TREE_CODE (t), DECL_NAME (t), TREE_TYPE (t)); - DECL_SOURCE_LINE (d) = DECL_SOURCE_LINE (t); - DECL_SOURCE_FILE (d) = DECL_SOURCE_FILE (t); + tree d; + + push_obstacks_nochange (); + saveable_allocation (); + d = copy_node (t); + pop_obstacks (); + if (DECL_RTL (t) != 0) { DECL_RTL (d) = copy_rtx_and_substitute (DECL_RTL (t), map); @@ -1938,19 +1942,14 @@ integrate_decl_tree (let, level, map) subst_constants (&DECL_RTL (d), NULL_RTX, map); apply_change_group (); } - else if (DECL_RTL (t)) - DECL_RTL (d) = copy_rtx (DECL_RTL (t)); - DECL_EXTERNAL (d) = DECL_EXTERNAL (t); - TREE_STATIC (d) = TREE_STATIC (t); - TREE_PUBLIC (d) = TREE_PUBLIC (t); - TREE_CONSTANT (d) = TREE_CONSTANT (t); - TREE_ADDRESSABLE (d) = TREE_ADDRESSABLE (t); - TREE_READONLY (d) = TREE_READONLY (t); - TREE_SIDE_EFFECTS (d) = TREE_SIDE_EFFECTS (t); /* These args would always appear unused, if not for this. */ TREE_USED (d) = 1; /* Prevent warning for shadowing with these. */ DECL_ABSTRACT_ORIGIN (d) = t; + + if (DECL_LANG_SPECIFIC (d)) + copy_lang_decl (d); + pushdecl (d); } -- 2.30.2