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
39d27142
Commit
39d27142
authored
Dec 17, 2012
by
Christoph Mallon
Browse files
belive: Inline be_lv_remove() into its only caller.
parent
831e040d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/belive.c
View file @
39d27142
...
...
@@ -156,15 +156,19 @@ static be_lv_info_node_t *be_lv_get_or_set(be_lv_t *li, ir_node *bl,
return
res
;
}
typedef
struct
lv_remove_walker_t
{
be_lv_t
*
lv
;
ir_node
const
*
irn
;
}
lv_remove_walker_t
;
/**
* Removes a node from the list of live variables of a block.
* @return 1 if the node was live at that block, 0 if not.
*/
static
int
be_lv_remove
(
be_lv_t
*
li
,
const
ir_node
*
bl
,
const
ir_node
*
irn
)
static
void
lv_remove_irn_walker
(
ir_node
*
const
bl
,
void
*
const
data
)
{
be_lv_info_t
*
irn_live
=
ir_nodehashmap_get
(
be_lv_info_t
,
&
li
->
map
,
bl
);
lv_remove_walker_t
*
const
w
=
(
lv_remove_walker_t
*
)
data
;
ir_node
const
*
const
irn
=
w
->
irn
;
be_lv_info_t
*
const
irn_live
=
ir_nodehashmap_get
(
be_lv_info_t
,
&
w
->
lv
->
map
,
bl
);
if
(
irn_live
!=
NULL
)
{
unsigned
n
=
irn_live
[
0
].
head
.
n_members
;
unsigned
pos
=
_be_liveness_bsearch
(
irn_live
,
irn
);
...
...
@@ -183,11 +187,8 @@ static int be_lv_remove(be_lv_t *li, const ir_node *bl,
--
irn_live
[
0
].
head
.
n_members
;
DBG
((
dbg
,
LEVEL_3
,
"
\t
deleting %+F from %+F at pos %d
\n
"
,
irn
,
bl
,
pos
));
return
1
;
}
}
return
0
;
}
static
struct
{
...
...
@@ -230,12 +231,6 @@ static void live_end_at_block(ir_node *const block, be_lv_state_t const state)
}
}
typedef
struct
lv_remove_walker_t
{
be_lv_t
*
lv
;
const
ir_node
*
irn
;
}
lv_remove_walker_t
;
/**
* Liveness analysis for a value.
* Compute the set of all blocks a value is live in.
...
...
@@ -295,12 +290,6 @@ static void liveness_for_node(ir_node *irn)
}
}
static
void
lv_remove_irn_walker
(
ir_node
*
bl
,
void
*
data
)
{
lv_remove_walker_t
*
w
=
(
lv_remove_walker_t
*
)
data
;
be_lv_remove
(
w
->
lv
,
bl
,
w
->
irn
);
}
/**
* Walker, collect all nodes for which we want calculate liveness info
* on an obstack.
...
...
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