From 5c10cb87bb1f31c97d2e376d584c976e2daf843c Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 6 Feb 2011 07:51:00 +0000 Subject: [PATCH] Use get_break_label() instead of duplicating it. [r28320] --- ast2firm.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/ast2firm.c b/ast2firm.c index cc2beb3..ff03e88 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -4953,6 +4953,14 @@ static void while_statement_to_firm(while_statement_t *statement) break_label = old_break_label; } +static ir_node *get_break_label(void) +{ + if (break_label == NULL) { + break_label = new_immBlock(); + } + return break_label; +} + static void do_while_statement_to_firm(do_while_statement_t *statement) { /* create the header block */ @@ -4969,7 +4977,7 @@ static void do_while_statement_to_firm(do_while_statement_t *statement) set_cur_block(body_block); statement_to_firm(statement->body); - ir_node *false_block = break_label; + ir_node *const false_block = get_break_label(); assert(continue_label == header_block); continue_label = old_continue_label; @@ -4977,10 +4985,6 @@ static void do_while_statement_to_firm(do_while_statement_t *statement) jump_if_reachable(header_block); - if (false_block == NULL) { - false_block = new_immBlock(); - } - /* create the condition */ mature_immBlock(header_block); set_cur_block(header_block); @@ -5091,14 +5095,6 @@ static void create_jump_statement(const statement_t *statement, set_cur_block(NULL); } -static ir_node *get_break_label(void) -{ - if (break_label == NULL) { - break_label = new_immBlock(); - } - return break_label; -} - static void switch_statement_to_firm(switch_statement_t *statement) { ir_node *first_block = NULL; -- 2.20.1