Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
a3aaea42
Commit
a3aaea42
authored
Mar 14, 2014
by
Matthias Braun
Browse files
lower_switch: add missing confirm_irg_properties() call
parent
20e229f9
Changes
1
Show whitespace changes
Inline
Side-by-side
ir/lower/lower_switch.c
View file @
a3aaea42
...
@@ -246,7 +246,7 @@ static void create_out_of_bounds_check(switch_info_t *info)
...
@@ -246,7 +246,7 @@ static void create_out_of_bounds_check(switch_info_t *info)
/**
/**
* normalize switch to work on an unsigned input with the first case at 0
* normalize switch to work on an unsigned input with the first case at 0
*/
*/
static
void
normalize_switch
(
switch_info_t
*
info
,
ir_mode
*
selector_mode
)
static
bool
normalize_switch
(
switch_info_t
*
info
,
ir_mode
*
selector_mode
)
{
{
ir_node
*
switchn
=
info
->
switchn
;
ir_node
*
switchn
=
info
->
switchn
;
ir_graph
*
irg
=
get_irn_irg
(
switchn
);
ir_graph
*
irg
=
get_irn_irg
(
switchn
);
...
@@ -295,10 +295,12 @@ static void normalize_switch(switch_info_t *info, ir_mode *selector_mode)
...
@@ -295,10 +295,12 @@ static void normalize_switch(switch_info_t *info, ir_mode *selector_mode)
needs_normalize
=
true
;
needs_normalize
=
true
;
}
}
if
(
needs_normalize
)
{
if
(
!
needs_normalize
)
return
false
;
set_Switch_selector
(
switchn
,
selector
);
set_Switch_selector
(
switchn
,
selector
);
normalize_table
(
switchn
,
mode
,
delta
);
normalize_table
(
switchn
,
mode
,
delta
);
}
return
true
;
}
}
/**
/**
...
@@ -439,7 +441,7 @@ static void find_switch_nodes(ir_node *block, void *ctx)
...
@@ -439,7 +441,7 @@ static void find_switch_nodes(ir_node *block, void *ctx)
if
(
!
lower_switch
)
{
if
(
!
lower_switch
)
{
/* we won't decompose the switch. But we must add an out-of-bounds
/* we won't decompose the switch. But we must add an out-of-bounds
* check */
* check */
normalize_switch
(
&
info
,
env
->
selector_mode
);
env
->
changed
|=
normalize_switch
(
&
info
,
env
->
selector_mode
);
return
;
return
;
}
}
...
@@ -479,5 +481,6 @@ void lower_switch(ir_graph *irg, unsigned small_switch, unsigned spare_size,
...
@@ -479,5 +481,6 @@ void lower_switch(ir_graph *irg, unsigned small_switch, unsigned spare_size,
irg_block_walk_graph
(
irg
,
find_switch_nodes
,
NULL
,
&
env
);
irg_block_walk_graph
(
irg
,
find_switch_nodes
,
NULL
,
&
env
);
ir_nodeset_destroy
(
&
env
.
processed
);
ir_nodeset_destroy
(
&
env
.
processed
);
confirm_irg_properties
(
irg
,
IR_GRAPH_PROPERTIES_NONE
);
confirm_irg_properties
(
irg
,
env
.
changed
?
IR_GRAPH_PROPERTIES_NONE
:
IR_GRAPH_PROPERTIES_ALL
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment