From 4f90ebd35f592c583be0c9b28aa053d090280ec9 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sat, 18 Mar 2006 22:34:12 +0000 Subject: [PATCH] copy_ia32_Immop_attr() added, needed to copy Immediates from one instruction to another --- ir/be/ia32/ia32_new_nodes.c | 21 +++++++++++++++++++++ ir/be/ia32/ia32_new_nodes.h | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/ir/be/ia32/ia32_new_nodes.c b/ir/be/ia32/ia32_new_nodes.c index 12a144842..59caaf074 100644 --- a/ir/be/ia32/ia32_new_nodes.c +++ b/ir/be/ia32/ia32_new_nodes.c @@ -901,6 +901,27 @@ void set_ia32_Immop_attr(ir_node *node, ir_node *cnst) { } } +/** + * Copy the attributes from Immop to an Immop + */ +void copy_ia32_Immop_attr(ir_node *node, ir_node *src) +{ + ia32_attr_t *na = get_ia32_attr(node); + ia32_attr_t *ca = get_ia32_attr(src); + + assert(get_ia32_cnst(src) != NULL); + na->tv = ca->tv; + + if (ca->sc) { + na->sc = copy_str(ca->sc); + na->cnst = na->sc; + } + else { + na->cnst = set_cnst_from_tv(na->cnst, na->tv); + na->sc = NULL; + } +} + /** * Copy the attributes from a Const to an ia32_Const */ diff --git a/ir/be/ia32/ia32_new_nodes.h b/ir/be/ia32/ia32_new_nodes.h index faaffb7b0..2a015ee35 100644 --- a/ir/be/ia32/ia32_new_nodes.h +++ b/ir/be/ia32/ia32_new_nodes.h @@ -314,6 +314,11 @@ void set_ia32_Const_type(ir_node *node, int type); */ void set_ia32_Immop_attr(ir_node *node, ir_node *cnst); +/** + * Copy the attributes from Immop to an Immop + */ +void copy_ia32_Immop_attr(ir_node *node, ir_node *src); + /** * Copy the attributes from a Const to an ia32_Const */ -- 2.20.1