aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <merrill@gnu.org>1994-05-14 01:56:51 +0000
committerJason Merrill <merrill@gnu.org>1994-05-14 01:56:51 +0000
commitf6bad6ff73b4581bd92c2a723c7217ef9d990660 (patch)
tree184ffe6256797ddb00f65066d8ac3fa58b2115f0
parent78b099bdf3f3c171c31ed723ec5a67d0727795c3 (diff)
downloadgcc-f6bad6ff73b4581bd92c2a723c7217ef9d990660.zip
gcc-f6bad6ff73b4581bd92c2a723c7217ef9d990660.tar.gz
gcc-f6bad6ff73b4581bd92c2a723c7217ef9d990660.tar.bz2
(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
-rw-r--r--gcc/integrate.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index e0b6f7a..0d03ba8 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);
}