+static ir_node *get_label_block(declaration_t *label)
+{
+ assert(label->namespace == NAMESPACE_LABEL);
+
+ if(label->declaration_type == DECLARATION_TYPE_LABEL_BLOCK) {
+ return label->v.block;
+ }
+ assert(label->declaration_type == DECLARATION_TYPE_UNKNOWN);
+
+ ir_node *old_cur_block = get_cur_block();
+ ir_node *block = new_immBlock();
+ set_cur_block(old_cur_block);
+
+ label->declaration_type = DECLARATION_TYPE_LABEL_BLOCK;
+ label->v.block = block;
+
+ ARR_APP1(imature_blocks, block);
+
+ return block;
+}
+
+static void label_to_firm(const label_statement_t *statement)
+{
+ ir_node *block = get_label_block(statement->label);
+
+ if(get_cur_block() != NULL) {
+ ir_node *jmp = new_Jmp();
+ add_immBlock_pred(block, jmp);
+ }
+
+ set_cur_block(block);
+ keep_alive(block);
+}
+
+static void goto_to_firm(const goto_statement_t *statement)
+{
+ if(get_cur_block() == NULL)
+ return;
+
+ ir_node *block = get_label_block(statement->label);
+ ir_node *jmp = new_Jmp();
+ add_immBlock_pred(block, jmp);
+
+ set_cur_block(NULL);
+}
+