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
43eec2cc
Commit
43eec2cc
authored
Jul 08, 2010
by
Matthias Braun
Browse files
constnes and comment improvements for irheights
[r27711]
parent
6094bf5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/libfirm/height.h
View file @
43eec2cc
...
...
@@ -34,12 +34,13 @@ typedef struct _heights_t heights_t;
/**
* Get the height of a node inside a basic block.
* The height of the node is the maximal number of edges between a sink node in that block and the node itself (plus 1).
* The height of the node is the maximal number of edges between a sink node in
* that block and the node itself (plus 1).
* @param h The heights object.
* @param irn The node.
* @return The height of the node.
*/
FIRM_API
unsigned
get_irn_height
(
heights_t
*
h
,
const
ir_node
*
irn
);
FIRM_API
unsigned
get_irn_height
(
const
heights_t
*
h
,
const
ir_node
*
irn
);
/**
* Check, if a certain node is reachable according to data dependence edges from another node.
...
...
ir/ana/height.c
View file @
43eec2cc
...
...
@@ -84,7 +84,7 @@ static void height_dump_cb(void *data, FILE *f, const ir_node *irn)
* @param tgt The node we try to reach.
* @return 1, one of tgt can be reached from curr, 0 else.
*/
static
bool
search
(
heights_t
*
h
,
const
ir_node
*
curr
,
const
ir_node
*
tgt
)
static
bool
search
(
const
heights_t
*
h
,
const
ir_node
*
curr
,
const
ir_node
*
tgt
)
{
irn_height_t
*
h_curr
;
irn_height_t
*
h_tgt
;
...
...
@@ -124,9 +124,11 @@ static bool search(heights_t *h, const ir_node *curr, const ir_node *tgt)
}
/**
* Check, if one node can be reached from another one, according to data dependence.
* Check, if one node can be reached from another one, according to data
* dependence.
*/
int
heights_reachable_in_block
(
heights_t
*
h
,
const
ir_node
*
n
,
const
ir_node
*
m
)
int
heights_reachable_in_block
(
heights_t
*
h
,
const
ir_node
*
n
,
const
ir_node
*
m
)
{
int
res
=
0
;
irn_height_t
*
hn
=
phase_get_irn_data
(
&
h
->
phase
,
n
);
...
...
@@ -218,9 +220,9 @@ static void compute_heights_in_block_walker(ir_node *block, void *data)
compute_heights_in_block
(
block
,
h
);
}
unsigned
get_irn_height
(
heights_t
*
heights
,
const
ir_node
*
irn
)
unsigned
get_irn_height
(
const
heights_t
*
heights
,
const
ir_node
*
irn
)
{
irn_height_t
*
h
=
phase_get_irn_data
(
&
heights
->
phase
,
irn
);
const
irn_height_t
*
h
=
phase_get_irn_data
(
&
heights
->
phase
,
irn
);
assert
(
h
&&
"No height information for node"
);
return
h
->
height
;
}
...
...
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