Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
c64dcb13
Commit
c64dcb13
authored
Aug 04, 2008
by
Christoph Mallon
Browse files
Using an obstack is slightly overkill.
[r20970]
parent
52e9e9eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/lower/lower_switch.c
View file @
c64dcb13
...
...
@@ -41,7 +41,6 @@
typedef
struct
walk_env
{
unsigned
spare_size
;
/**< the allowed spare size for table switches */
struct
obstack
obst
;
/**< the obstack where data is allocated on */
int
changed
;
/**< indicates whether a change was performed */
}
walk_env_t
;
...
...
@@ -207,7 +206,7 @@ static void find_cond_nodes(ir_node *block, void *ctx)
*/
numcases
=
get_irn_n_outs
(
cond
)
-
1
;
// does not contain default case
cases
=
obstack_alloc
(
&
env
->
obst
,
numcases
*
sizeof
(
*
cases
)
)
;
NEW_ARR_A
(
case_data_t
,
cases
,
num
cases
);
default_pn
=
get_Cond_defaultProj
(
cond
);
ifcas_env
.
sel
=
sel
;
...
...
@@ -239,8 +238,6 @@ static void find_cond_nodes(ir_node *block, void *ctx)
/* Connect new default case users */
set_irn_in
(
defblock
,
ifcas_env
.
defindex
,
ifcas_env
.
defusers
);
obstack_free
(
&
env
->
obst
,
cases
);
}
/**
...
...
@@ -258,7 +255,6 @@ void lower_switch(ir_graph *irg, unsigned spare_size)
current_ir_graph
=
irg
;
obstack_init
(
&
env
.
obst
);
env
.
spare_size
=
spare_size
;
remove_critical_cf_edges
(
irg
);
...
...
@@ -274,6 +270,5 @@ void lower_switch(ir_graph *irg, unsigned spare_size)
set_irg_loopinfo_inconsistent
(
irg
);
}
obstack_free
(
&
env
.
obst
,
NULL
);
current_ir_graph
=
rem
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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