summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-10-22 12:56:33 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2012-10-22 13:02:29 +0200
commit47143e8e0c7b1da7d1e155a5776ce1d5d68c51ea (patch)
tree9380641cf6bf0d4a3447ff18c57456c1a5184bfc
parentf3bd81790ada80eea554c6418e62ff22d9fd03e7 (diff)
Move changing current_ir_graph from get_label_block() to the only caller needing it.
-rw-r--r--ast2firm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ast2firm.c b/ast2firm.c
index fa29883..18283b8 100644
--- a/ast2firm.c
+++ b/ast2firm.c
@@ -3232,12 +3232,7 @@ static ir_node *get_label_block(label_t *label)
if (label->block != NULL)
return label->block;
- /* beware: might be called from create initializer with current_ir_graph
- * set to const_code_irg. */
- PUSH_IRG(current_function);
ir_node *block = new_immBlock();
- POP_IRG();
-
label->block = block;
ARR_APP1(label_t *, all_labels, label);
@@ -3250,9 +3245,13 @@ static ir_node *get_label_block(label_t *label)
*/
static ir_node *label_address_to_firm(const label_address_expression_t *label)
{
+ /* Beware: Might be called from create initializer with current_ir_graph
+ * set to const_code_irg. */
+ PUSH_IRG(current_function);
dbg_info *dbgi = get_dbg_info(&label->base.source_position);
ir_node *block = get_label_block(label->label);
ir_entity *entity = create_Block_entity(block);
+ POP_IRG();
symconst_symbol value;
value.entity_p = entity;