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
49938636
Commit
49938636
authored
May 25, 2011
by
Andreas Zwinkau
Browse files
reuse is_switch_Cond function
parent
27fe9e1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/cfopt.c
View file @
49938636
...
...
@@ -77,6 +77,11 @@ static bool is_Block_removable(ir_node *block)
return
get_Block_mark
(
block
);
}
static
bool
is_switch_Cond
(
ir_node
*
cond
)
{
ir_node
*
sel
=
get_Cond_selector
(
cond
);
return
get_irn_mode
(
sel
)
!=
mode_b
;
}
static
void
clear_link
(
ir_node
*
node
,
void
*
ctx
)
{
(
void
)
ctx
;
...
...
@@ -114,12 +119,9 @@ static void collect_nodes(ir_node *n, void *ctx)
ir_node
*
pred
=
get_Proj_pred
(
n
);
set_irn_link
(
n
,
get_irn_link
(
pred
));
set_irn_link
(
pred
,
n
);
}
else
if
(
is_Cond
(
n
))
{
ir_node
*
sel
=
get_Cond_selector
(
n
);
if
(
get_irn_mode
(
sel
)
!=
mode_b
)
{
/* found a switch-Cond, collect */
ARR_APP1
(
ir_node
*
,
env
->
switch_conds
,
n
);
}
}
else
if
(
is_Cond
(
n
)
&&
is_switch_Cond
(
n
))
{
/* found a switch-Cond, collect */
ARR_APP1
(
ir_node
*
,
env
->
switch_conds
,
n
);
}
}
}
...
...
@@ -536,10 +538,6 @@ static bool handle_switch_cond(ir_node *cond)
return
false
;
}
static
bool
is_switch_Cond
(
ir_node
*
cond
)
{
return
get_irn_mode
(
get_Cond_selector
(
cond
))
!=
mode_b
;
}
static
bool
get_phase_flag
(
ir_phase
*
block_info
,
ir_node
*
block
,
int
offset
)
{
return
((
int
)
phase_get_irn_data
(
block_info
,
block
))
&
(
1
<<
offset
);
}
...
...
Write
Preview
Supports
Markdown
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