From 6b0c326358023b87c32c29f93d2f56e1d0036dcc Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 5 Jun 2007 21:59:08 +0000 Subject: [PATCH] calculates now the address_taken flag for methods, needed for the calling convention optimization [r14338] --- ir/ana/irmemory.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ir/ana/irmemory.c b/ir/ana/irmemory.c index a457a5e56..9d204e695 100644 --- a/ir/ana/irmemory.c +++ b/ir/ana/irmemory.c @@ -768,7 +768,7 @@ static int is_hidden_cast(ir_mode *mode, ir_mode *ent_mode) { * @param irn the node */ static ir_address_taken_state find_address_taken_state(ir_node *irn) { - int i; + int i, j; ir_mode *emode, *mode; ir_node *value; ir_entity *ent; @@ -810,7 +810,12 @@ static ir_address_taken_state find_address_taken_state(ir_node *irn) { case iro_Call: /* Only the call address is not an address taker but this is an uninteresting case, so we ignore it here. */ - return ir_address_taken; + for (j = get_Call_n_params(succ) - 1; j >= 0; --j) { + ir_node *param = get_Call_param(succ, j); + if (param == irn) + return ir_address_taken; + } + break; default: /* another op, the address may be taken */ -- 2.20.1