projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7754cab
)
Handle fallthrough when generating IR for case labels.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Fri, 16 Nov 2007 23:01:46 +0000
(23:01 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Fri, 16 Nov 2007 23:01:46 +0000
(23:01 +0000)
[r18427]
ast2firm.c
patch
|
blob
|
history
diff --git
a/ast2firm.c
b/ast2firm.c
index
552e961
..
749a3f6
100644
(file)
--- a/
ast2firm.c
+++ b/
ast2firm.c
@@
-1840,6
+1840,8
@@
static void case_label_to_firm(const case_label_statement_t *statement)
{
dbg_info *dbgi = get_dbg_info(&statement->statement.source_position);
+ ir_node *const fallthrough = (get_cur_block() == NULL ? NULL : new_Jmp());
+
/* let's create a node and hope firm constant folding creates a Const
* node... */
ir_node *proj;
@@
-1858,6
+1860,9
@@
static void case_label_to_firm(const case_label_statement_t *statement)
}
ir_node *block = new_immBlock();
+ if (fallthrough != NULL) {
+ add_immBlock_pred(block, fallthrough);
+ }
add_immBlock_pred(block, proj);
mature_immBlock(block);
}