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
afc76013
Commit
afc76013
authored
May 26, 2008
by
Michael Beck
Browse files
add *_Block_mark() api to mark easily Blocks in the graph
[r19773]
parent
a423b8b8
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/libfirm/irgraph.h
View file @
afc76013
...
...
@@ -521,16 +521,22 @@ int using_irn_visited(const ir_graph *irg);
void
set_using_irn_link
(
ir_graph
*
irg
);
void
clear_using_irn_link
(
ir_graph
*
irg
);
int
using_irn_link
(
const
ir_graph
*
irg
);
void
set_using_block_mark
(
ir_graph
*
irg
);
void
clear_using_block_mark
(
ir_graph
*
irg
);
int
using_block_mark
(
const
ir_graph
*
irg
);
#else
static
INLINE
void
set_using_block_visited
(
ir_graph
*
irg
)
{
(
void
)
irg
;
}
static
INLINE
void
clear_using_block_visited
(
ir_graph
*
irg
)
{
(
void
)
irg
;
}
static
INLINE
int
using_block_visited
(
const
ir_graph
*
irg
)
{
(
void
)
irg
;
return
0
;
}
static
INLINE
void
set_using_irn_visited
(
ir_graph
*
irg
)
{
(
void
)
irg
;
}
static
INLINE
void
clear_using_irn_visited
(
ir_graph
*
irg
)
{
(
void
)
irg
;
}
static
INLINE
int
using_irn_visited
(
const
ir_graph
*
irg
)
{
(
void
)
irg
;
return
0
;
}
static
INLINE
void
set_using_irn_link
(
ir_graph
*
irg
)
{
(
void
)
irg
;
}
static
INLINE
void
clear_using_irn_link
(
ir_graph
*
irg
)
{
(
void
)
irg
;
}
static
INLINE
int
using_irn_link
(
const
ir_graph
*
irg
)
{
(
void
)
irg
;
return
0
;
}
#define set_using_block_visited(irg)
#define clear_using_block_visited(irg)
#define using_block_visited(irg) 0
#define set_using_irn_visited(irg)
#define clear_using_irn_visited(irg)
#define using_irn_visited(irg) 0
#define set_using_irn_link(irg)
#define clear_using_irn_link(irg)
#define using_irn_link(irg) 0
#define set_using_block_mark(irg)
#define clear_using_block_mark(irg)
#define using_block_mark(irg) 0
#endif
/** Normalization: Move Proj nodes into the same block as its predecessors */
...
...
ir/ir/irgraph.c
View file @
afc76013
...
...
@@ -1084,7 +1084,21 @@ void clear_using_irn_link(ir_graph *irg) {
int
using_irn_link
(
const
ir_graph
*
irg
)
{
return
irg
->
using_irn_link
;
}
#endif
void
set_using_block_mark
(
ir_graph
*
irg
)
{
assert
(
irg
->
using_block_mark
==
0
);
irg
->
using_block_mark
=
1
;
}
void
clear_using_block_mark
(
ir_graph
*
irg
)
{
assert
(
irg
->
using_block_mark
==
1
);
irg
->
using_block_mark
=
0
;
}
int
using_block_mark
(
const
ir_graph
*
irg
)
{
return
irg
->
using_block_mark
;
}
#endif
/* NDEBUG */
/* Returns a estimated node count of the irg. */
unsigned
(
get_irg_estimated_node_cnt
)(
const
ir_graph
*
irg
)
{
...
...
ir/ir/irnode_t.h
View file @
afc76013
...
...
@@ -959,6 +959,19 @@ _add_Block_phi(ir_node *block, ir_node *phi) {
_set_Block_phis
(
block
,
phi
);
}
/** Get the Block mark (single bit). */
static
INLINE
unsigned
_get_Block_mark
(
const
ir_node
*
block
)
{
assert
(
_is_Block
(
block
));
return
block
->
attr
.
block
.
marked
;
}
/** Set the Block mark (single bit). */
static
INLINE
void
_set_Block_mark
(
ir_node
*
block
,
unsigned
mark
)
{
assert
(
_is_Block
(
block
));
block
->
attr
.
block
.
marked
=
mark
;
}
/* this section MUST contain all inline functions */
#define is_ir_node(thing) _is_ir_node(thing)
...
...
@@ -1080,7 +1093,9 @@ _add_Block_phi(ir_node *block, ir_node *phi) {
#define set_Block_phis(block, phi) _set_Block_phis(block, phi)
#define get_Block_phis(block) _get_Block_phis(block)
#define add_Block_phi(block, phi) _add_block_phi(block, phi)
#define add_Block_phi(block, phi) _add_Block_phi(block, phi)
#define get_Block_mark(block) _get_Block_mark(block)
#define set_Block_mark(block, mark) _set_Block_mark(block, mark)
#define set_Phi_next(node, phi) _set_Phi_next(node, phi)
#define get_Phi_next(node) _get_Phi_next(node)
...
...
ir/ir/irtypes.h
View file @
afc76013
...
...
@@ -126,6 +126,7 @@ typedef struct {
unsigned
is_dead
:
1
;
/**< If set, the block is dead (and could be replace by a Bad. */
unsigned
is_mb_head
:
1
;
/**< Set if this block is a macroblock head. */
unsigned
has_label
:
1
;
/**< Set if this block has a label assigned. */
unsigned
marked
:
1
;
/**< Can be set/unset to temporary mark a block. */
ir_node
**
graph_arr
;
/**< An array to store all parameters. */
/* Attributes holding analyses information */
ir_dom_info
dom
;
/**< Datastructure that holds information about dominators.
...
...
@@ -502,6 +503,7 @@ struct ir_graph {
unsigned
using_irn_visited
:
1
;
/**< set to 1 if we are currently using the visited flag */
unsigned
using_block_visited
:
1
;
/**< set to 1 if we are currently using the block_visited flag */
unsigned
using_irn_link
:
1
;
/**< set to 1 if we are currently using the irn_link fields */
unsigned
using_block_mark
:
1
;
/**< set to 1 if we are currently using the block mark flags */
#endif
};
...
...
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