Commit 969078bf authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Copy the debug info when creating and lowering CopyBs.

parent e606a37d
......@@ -836,9 +836,10 @@ static void transform_return(ir_node *ret, size_t n_ret_com, wlk_env *env)
++n_cr_opt;
} else {
/* copy-return optimization is impossible, do the copy. */
bool is_volatile = is_partly_volatile(pred);
mem = new_r_CopyB(block, mem, arg, pred, type,
is_volatile ? cons_volatile : cons_none);
bool const is_volatile = is_partly_volatile(pred);
dbg_info *const dbgi = get_irn_dbg_info(ret);
ir_cons_flags const cons = is_volatile ? cons_volatile : cons_none;
mem = new_rd_CopyB(dbgi, block, mem, arg, pred, type, cons);
}
}
/* replace the in of the Return */
......
......@@ -50,6 +50,7 @@ static ir_mode *get_ir_mode(unsigned mode_bytes)
static void lower_small_copyb_node(ir_node *irn)
{
ir_graph *irg = get_irn_irg(irn);
dbg_info *dbgi = get_irn_dbg_info(irn);
ir_node *block = get_nodes_block(irn);
ir_type *tp = get_CopyB_type(irn);
ir_node *addr_src = get_CopyB_src(irn);
......@@ -72,15 +73,14 @@ static void lower_small_copyb_node(ir_node *irn)
ir_node *addr_const = new_r_Const_long(irg, mode_ref_int, offset);
ir_node *add = new_r_Add(block, addr_src, addr_const);
ir_node *load = new_r_Load(block, mem, add, mode, tp, flags);
ir_node *load = new_rd_Load(dbgi, block, mem, add, mode, tp, flags);
ir_node *load_res = new_r_Proj(load, mode, pn_Load_res);
ir_node *load_mem = new_r_Proj(load, mode_M, pn_Load_M);
ir_node *addr_const2 = new_r_Const_long(irg, mode_ref_int, offset);
ir_node *add2 = new_r_Add(block, addr_dst, addr_const2);
ir_node *store = new_r_Store(block, load_mem, add2, load_res,
tp, flags);
ir_node *store = new_rd_Store(dbgi, block, load_mem, add2, load_res, tp, flags);
ir_node *store_mem = new_r_Proj(store, mode_M, pn_Store_M);
mem = store_mem;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment