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
e8fda67a
Commit
e8fda67a
authored
Nov 10, 2003
by
Götz Lindenmaier
Browse files
added attr irg to block, removed from start, call, end.
removed exc attr. [r2027]
parent
9bda0c6a
Changes
5
Hide whitespace changes
Inline
Side-by-side
ir/ir/ircons.c
View file @
e8fda67a
...
@@ -60,8 +60,9 @@ new_rd_Block (dbg_info* db, ir_graph *irg, int arity, ir_node **in)
...
@@ -60,8 +60,9 @@ new_rd_Block (dbg_info* db, ir_graph *irg, int arity, ir_node **in)
set_Block_matured
(
res
,
1
);
set_Block_matured
(
res
,
1
);
set_Block_block_visited
(
res
,
0
);
set_Block_block_visited
(
res
,
0
);
res
->
attr
.
block
.
exc
=
exc_normal
;
//res->attr.block.exc = exc_normal;
res
->
attr
.
block
.
handler_entry
=
0
;
//res->attr.block.handler_entry = 0;
res
->
attr
.
block
.
irg
=
irg
;
res
->
attr
.
block
.
backedge
=
new_backedge_arr
(
irg
->
obst
,
arity
);
res
->
attr
.
block
.
backedge
=
new_backedge_arr
(
irg
->
obst
,
arity
);
res
->
attr
.
block
.
in_cg
=
NULL
;
res
->
attr
.
block
.
in_cg
=
NULL
;
res
->
attr
.
block
.
cg_backedge
=
NULL
;
res
->
attr
.
block
.
cg_backedge
=
NULL
;
...
@@ -76,7 +77,7 @@ new_rd_Start (dbg_info* db, ir_graph *irg, ir_node *block)
...
@@ -76,7 +77,7 @@ new_rd_Start (dbg_info* db, ir_graph *irg, ir_node *block)
ir_node
*
res
;
ir_node
*
res
;
res
=
new_ir_node
(
db
,
irg
,
block
,
op_Start
,
mode_T
,
0
,
NULL
);
res
=
new_ir_node
(
db
,
irg
,
block
,
op_Start
,
mode_T
,
0
,
NULL
);
res
->
attr
.
start
.
irg
=
irg
;
//
res->attr.start.irg = irg;
irn_vrfy_irg
(
res
,
irg
);
irn_vrfy_irg
(
res
,
irg
);
return
res
;
return
res
;
...
@@ -743,7 +744,7 @@ new_rd_CallBegin (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *call)
...
@@ -743,7 +744,7 @@ new_rd_CallBegin (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *call)
ir_node
*
res
;
ir_node
*
res
;
in
[
0
]
=
get_Call_ptr
(
call
);
in
[
0
]
=
get_Call_ptr
(
call
);
res
=
new_ir_node
(
db
,
irg
,
block
,
op_CallBegin
,
mode_T
,
1
,
in
);
res
=
new_ir_node
(
db
,
irg
,
block
,
op_CallBegin
,
mode_T
,
1
,
in
);
res
->
attr
.
callbegin
.
irg
=
irg
;
//
res->attr.callbegin.irg = irg;
res
->
attr
.
callbegin
.
call
=
call
;
res
->
attr
.
callbegin
.
call
=
call
;
res
=
optimize_node
(
res
);
res
=
optimize_node
(
res
);
irn_vrfy_irg
(
res
,
irg
);
irn_vrfy_irg
(
res
,
irg
);
...
@@ -756,7 +757,7 @@ new_rd_EndReg (dbg_info *db, ir_graph *irg, ir_node *block)
...
@@ -756,7 +757,7 @@ new_rd_EndReg (dbg_info *db, ir_graph *irg, ir_node *block)
ir_node
*
res
;
ir_node
*
res
;
res
=
new_ir_node
(
db
,
irg
,
block
,
op_EndReg
,
mode_T
,
-
1
,
NULL
);
res
=
new_ir_node
(
db
,
irg
,
block
,
op_EndReg
,
mode_T
,
-
1
,
NULL
);
res
->
attr
.
end
.
irg
=
irg
;
//
res->attr.end.irg = irg;
irn_vrfy_irg
(
res
,
irg
);
irn_vrfy_irg
(
res
,
irg
);
return
res
;
return
res
;
...
@@ -768,7 +769,7 @@ new_rd_EndExcept (dbg_info *db, ir_graph *irg, ir_node *block)
...
@@ -768,7 +769,7 @@ new_rd_EndExcept (dbg_info *db, ir_graph *irg, ir_node *block)
ir_node
*
res
;
ir_node
*
res
;
res
=
new_ir_node
(
db
,
irg
,
block
,
op_EndExcept
,
mode_T
,
-
1
,
NULL
);
res
=
new_ir_node
(
db
,
irg
,
block
,
op_EndExcept
,
mode_T
,
-
1
,
NULL
);
res
->
attr
.
end
.
irg
=
irg
;
//
res->attr.end.irg = irg;
irn_vrfy_irg
(
res
,
irg
);
irn_vrfy_irg
(
res
,
irg
);
return
res
;
return
res
;
...
@@ -839,65 +840,65 @@ INLINE ir_node *new_r_SymConst (ir_graph *irg, ir_node *block,
...
@@ -839,65 +840,65 @@ INLINE ir_node *new_r_SymConst (ir_graph *irg, ir_node *block,
return
new_rd_SymConst
(
NULL
,
irg
,
block
,
value
,
symkind
);
return
new_rd_SymConst
(
NULL
,
irg
,
block
,
value
,
symkind
);
}
}
INLINE
ir_node
*
new_r_Sel
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
store
,
INLINE
ir_node
*
new_r_Sel
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
store
,
ir_node
*
objptr
,
int
n_index
,
ir_node
**
index
,
ir_node
*
objptr
,
int
n_index
,
ir_node
**
index
,
entity
*
ent
)
{
entity
*
ent
)
{
return
new_rd_Sel
(
NULL
,
irg
,
block
,
store
,
objptr
,
n_index
,
index
,
ent
);
return
new_rd_Sel
(
NULL
,
irg
,
block
,
store
,
objptr
,
n_index
,
index
,
ent
);
}
}
INLINE
ir_node
*
new_r_InstOf
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
store
,
ir_node
*
objptr
,
INLINE
ir_node
*
new_r_InstOf
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
store
,
ir_node
*
objptr
,
type
*
ent
)
{
type
*
ent
)
{
return
(
new_rd_InstOf
(
NULL
,
irg
,
block
,
store
,
objptr
,
ent
));
return
(
new_rd_InstOf
(
NULL
,
irg
,
block
,
store
,
objptr
,
ent
));
}
}
INLINE
ir_node
*
new_r_Call
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
store
,
INLINE
ir_node
*
new_r_Call
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
store
,
ir_node
*
callee
,
int
arity
,
ir_node
**
in
,
ir_node
*
callee
,
int
arity
,
ir_node
**
in
,
type
*
tp
)
{
type
*
tp
)
{
return
new_rd_Call
(
NULL
,
irg
,
block
,
store
,
callee
,
arity
,
in
,
tp
);
return
new_rd_Call
(
NULL
,
irg
,
block
,
store
,
callee
,
arity
,
in
,
tp
);
}
}
INLINE
ir_node
*
new_r_Add
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Add
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
return
new_rd_Add
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
return
new_rd_Add
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
}
}
INLINE
ir_node
*
new_r_Sub
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Sub
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
return
new_rd_Sub
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
return
new_rd_Sub
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
}
}
INLINE
ir_node
*
new_r_Minus
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Minus
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op
,
ir_mode
*
mode
)
{
ir_node
*
op
,
ir_mode
*
mode
)
{
return
new_rd_Minus
(
NULL
,
irg
,
block
,
op
,
mode
);
return
new_rd_Minus
(
NULL
,
irg
,
block
,
op
,
mode
);
}
}
INLINE
ir_node
*
new_r_Mul
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Mul
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
return
new_rd_Mul
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
return
new_rd_Mul
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
}
}
INLINE
ir_node
*
new_r_Quot
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Quot
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
return
new_rd_Quot
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
return
new_rd_Quot
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
}
}
INLINE
ir_node
*
new_r_DivMod
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_DivMod
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
return
new_rd_DivMod
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
return
new_rd_DivMod
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
}
}
INLINE
ir_node
*
new_r_Div
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Div
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
return
new_rd_Div
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
return
new_rd_Div
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
}
}
INLINE
ir_node
*
new_r_Mod
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Mod
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
ir_node
*
memop
,
ir_node
*
op1
,
ir_node
*
op2
)
{
return
new_rd_Mod
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
return
new_rd_Mod
(
NULL
,
irg
,
block
,
memop
,
op1
,
op2
);
}
}
INLINE
ir_node
*
new_r_Abs
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Abs
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op
,
ir_mode
*
mode
)
{
ir_node
*
op
,
ir_mode
*
mode
)
{
return
new_rd_Abs
(
NULL
,
irg
,
block
,
op
,
mode
);
return
new_rd_Abs
(
NULL
,
irg
,
block
,
op
,
mode
);
}
}
INLINE
ir_node
*
new_r_And
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_And
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
return
new_rd_And
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
return
new_rd_And
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
}
}
INLINE
ir_node
*
new_r_Or
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Or
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
return
new_rd_Or
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
return
new_rd_Or
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
}
}
INLINE
ir_node
*
new_r_Eor
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Eor
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
ir_node
*
op1
,
ir_node
*
op2
,
ir_mode
*
mode
)
{
return
new_rd_Eor
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
return
new_rd_Eor
(
NULL
,
irg
,
block
,
op1
,
op2
,
mode
);
}
}
INLINE
ir_node
*
new_r_Not
(
ir_graph
*
irg
,
ir_node
*
block
,
INLINE
ir_node
*
new_r_Not
(
ir_graph
*
irg
,
ir_node
*
block
,
...
@@ -1016,7 +1017,7 @@ new_d_Start (dbg_info* db)
...
@@ -1016,7 +1017,7 @@ new_d_Start (dbg_info* db)
res
=
new_ir_node
(
db
,
current_ir_graph
,
current_ir_graph
->
current_block
,
res
=
new_ir_node
(
db
,
current_ir_graph
,
current_ir_graph
->
current_block
,
op_Start
,
mode_T
,
0
,
NULL
);
op_Start
,
mode_T
,
0
,
NULL
);
res
->
attr
.
start
.
irg
=
current_ir_graph
;
//
res->attr.start.irg = current_ir_graph;
res
=
optimize_node
(
res
);
res
=
optimize_node
(
res
);
irn_vrfy_irg
(
res
,
current_ir_graph
);
irn_vrfy_irg
(
res
,
current_ir_graph
);
...
@@ -2222,8 +2223,9 @@ ir_node *new_d_immBlock (dbg_info* db) {
...
@@ -2222,8 +2223,9 @@ ir_node *new_d_immBlock (dbg_info* db) {
res
=
new_ir_node
(
db
,
current_ir_graph
,
NULL
,
op_Block
,
mode_BB
,
-
1
,
NULL
);
res
=
new_ir_node
(
db
,
current_ir_graph
,
NULL
,
op_Block
,
mode_BB
,
-
1
,
NULL
);
current_ir_graph
->
current_block
=
res
;
current_ir_graph
->
current_block
=
res
;
res
->
attr
.
block
.
matured
=
0
;
res
->
attr
.
block
.
matured
=
0
;
res
->
attr
.
block
.
exc
=
exc_normal
;
//res->attr.block.exc = exc_normal;
res
->
attr
.
block
.
handler_entry
=
0
;
//res->attr.block.handler_entry = 0;
res
->
attr
.
block
.
irg
=
current_ir_graph
;
res
->
attr
.
block
.
backedge
=
NULL
;
res
->
attr
.
block
.
backedge
=
NULL
;
res
->
attr
.
block
.
in_cg
=
NULL
;
res
->
attr
.
block
.
in_cg
=
NULL
;
res
->
attr
.
block
.
cg_backedge
=
NULL
;
res
->
attr
.
block
.
cg_backedge
=
NULL
;
...
@@ -2383,7 +2385,7 @@ ir_node *new_Sel (ir_node *store, ir_node *objptr, int arity, ir_node **in,
...
@@ -2383,7 +2385,7 @@ ir_node *new_Sel (ir_node *store, ir_node *objptr, int arity, ir_node **in,
return
new_d_Sel
(
NULL
,
store
,
objptr
,
arity
,
in
,
ent
);
return
new_d_Sel
(
NULL
,
store
,
objptr
,
arity
,
in
,
ent
);
}
}
ir_node
*
new_InstOf
(
ir_node
*
store
,
ir_node
*
objptr
,
type
*
ent
)
{
ir_node
*
new_InstOf
(
ir_node
*
store
,
ir_node
*
objptr
,
type
*
ent
)
{
return
(
new_d_InstOf
(
NULL
,
store
,
objptr
,
ent
)
)
;
return
new_d_InstOf
(
NULL
,
store
,
objptr
,
ent
);
}
}
ir_node
*
new_Call
(
ir_node
*
store
,
ir_node
*
callee
,
int
arity
,
ir_node
**
in
,
ir_node
*
new_Call
(
ir_node
*
store
,
ir_node
*
callee
,
int
arity
,
ir_node
**
in
,
type
*
tp
)
{
type
*
tp
)
{
...
...
ir/ir/irgopt.c
View file @
e8fda67a
...
@@ -510,10 +510,13 @@ void remove_bad_predecessors(ir_graph *irg) {
...
@@ -510,10 +510,13 @@ void remove_bad_predecessors(ir_graph *irg) {
/* Funcionality for inlining */
/* Funcionality for inlining */
/**********************************************************************/
/**********************************************************************/
/* Copy node for inlineing. Copies the node by calling copy_node and
/* Copy node for inlineing. Updates attributes that change when
then updates the entity if it's a local one. env must be a pointer
* inlineing but not for dead node elimination.
to the frame type of the procedure. The new entities must be in
*
the link field of the entities. */
* Copies the node by calling copy_node and then updates the entity if
* it's a local one. env must be a pointer of the frame type of the
* inlined procedure. The new entities must be in the link field of
* the entities. */
static
INLINE
void
static
INLINE
void
copy_node_inline
(
ir_node
*
n
,
void
*
env
)
{
copy_node_inline
(
ir_node
*
n
,
void
*
env
)
{
ir_node
*
new
;
ir_node
*
new
;
...
@@ -526,10 +529,12 @@ copy_node_inline (ir_node *n, void *env) {
...
@@ -526,10 +529,12 @@ copy_node_inline (ir_node *n, void *env) {
if
(
get_entity_owner
(
get_Sel_entity
(
n
))
==
frame_tp
)
{
if
(
get_entity_owner
(
get_Sel_entity
(
n
))
==
frame_tp
)
{
set_Sel_entity
(
new
,
get_entity_link
(
get_Sel_entity
(
n
)));
set_Sel_entity
(
new
,
get_entity_link
(
get_Sel_entity
(
n
)));
}
}
}
else
if
(
get_irn_op
(
n
)
==
op_Block
)
{
new
=
get_new_node
(
n
);
new
->
attr
.
block
.
irg
=
current_ir_graph
;
}
}
}
}
#include
"irdump.h"
void
inline_method
(
ir_node
*
call
,
ir_graph
*
called_graph
)
{
void
inline_method
(
ir_node
*
call
,
ir_graph
*
called_graph
)
{
ir_node
*
pre_call
;
ir_node
*
pre_call
;
...
@@ -889,8 +894,6 @@ void inline_small_irgs(ir_graph *irg, int size) {
...
@@ -889,8 +894,6 @@ void inline_small_irgs(ir_graph *irg, int size) {
/* will be executed only if needed. */
/* will be executed only if needed. */
/********************************************************************/
/********************************************************************/
#include
"irdump.h"
static
pdeq
*
worklist
;
/* worklist of ir_node*s */
static
pdeq
*
worklist
;
/* worklist of ir_node*s */
/* Find the earliest correct block for N. --- Place N into the
/* Find the earliest correct block for N. --- Place N into the
...
...
ir/ir/irnode.c
View file @
e8fda67a
...
@@ -587,7 +587,7 @@ set_Block_graph_arr (ir_node *node, int pos, ir_node *value) {
...
@@ -587,7 +587,7 @@ set_Block_graph_arr (ir_node *node, int pos, ir_node *value) {
node
->
attr
.
block
.
graph_arr
[
pos
+
1
]
=
value
;
node
->
attr
.
block
.
graph_arr
[
pos
+
1
]
=
value
;
}
}
/* handler handling for Blocks */
/* handler handling for Blocks *
/
void
void
set_Block_handler (ir_node *block, ir_node *handler) {
set_Block_handler (ir_node *block, ir_node *handler) {
assert ((block->op == op_Block));
assert ((block->op == op_Block));
...
@@ -601,7 +601,7 @@ get_Block_handler (ir_node *block) {
...
@@ -601,7 +601,7 @@ get_Block_handler (ir_node *block) {
return (block->attr.block.handler_entry);
return (block->attr.block.handler_entry);
}
}
/* handler handling for Nodes */
/
* handler handling for Nodes *
/
void
void
set_Node_handler (ir_node *node, ir_node *handler) {
set_Node_handler (ir_node *node, ir_node *handler) {
set_Block_handler (get_nodes_Block (node), handler);
set_Block_handler (get_nodes_Block (node), handler);
...
@@ -612,7 +612,7 @@ get_Node_handler (ir_node *node) {
...
@@ -612,7 +612,7 @@ get_Node_handler (ir_node *node) {
return (get_Block_handler (get_nodes_Block (node)));
return (get_Block_handler (get_nodes_Block (node)));
}
}
/* exc_t handling for Blocks */
/
* exc_t handling for Blocks *
/
void set_Block_exc (ir_node *block, exc_t exc) {
void set_Block_exc (ir_node *block, exc_t exc) {
assert ((block->op == op_Block));
assert ((block->op == op_Block));
block->attr.block.exc = exc;
block->attr.block.exc = exc;
...
@@ -620,11 +620,10 @@ void set_Block_exc (ir_node *block, exc_t exc) {
...
@@ -620,11 +620,10 @@ void set_Block_exc (ir_node *block, exc_t exc) {
exc_t get_Block_exc (ir_node *block) {
exc_t get_Block_exc (ir_node *block) {
assert ((block->op == op_Block));
assert ((block->op == op_Block));
return (block->attr.block.exc);
return (block->attr.block.exc);
}
}
/* exc_t handling for Nodes */
/
* exc_t handling for Nodes *
/
void set_Node_exc (ir_node *node, exc_t exc) {
void set_Node_exc (ir_node *node, exc_t exc) {
set_Block_exc (get_nodes_Block (node), exc);
set_Block_exc (get_nodes_Block (node), exc);
}
}
...
@@ -632,6 +631,7 @@ void set_Node_exc (ir_node *node, exc_t exc) {
...
@@ -632,6 +631,7 @@ void set_Node_exc (ir_node *node, exc_t exc) {
exc_t get_Node_exc (ir_node *node) {
exc_t get_Node_exc (ir_node *node) {
return (get_Block_exc (get_nodes_Block (node)));
return (get_Block_exc (get_nodes_Block (node)));
}
}
*/
void
set_Block_cg_cfgpred_arr
(
ir_node
*
node
,
int
arity
,
ir_node
**
in
)
{
void
set_Block_cg_cfgpred_arr
(
ir_node
*
node
,
int
arity
,
ir_node
**
in
)
{
assert
(
node
->
op
==
op_Block
);
assert
(
node
->
op
==
op_Block
);
...
@@ -681,15 +681,15 @@ void remove_Block_cg_cfgpred_arr(ir_node * node) {
...
@@ -681,15 +681,15 @@ void remove_Block_cg_cfgpred_arr(ir_node * node) {
/* Start references the irg it is in. */
/* Start references the irg it is in. */
INLINE
ir_graph
*
INLINE
ir_graph
*
get_Start_irg
(
ir_node
*
node
)
{
get_Start_irg
(
ir_node
*
node
)
{
assert
(
node
->
op
==
op_Start
);
return
get_irn_irg
(
node
);
return
node
->
attr
.
start
.
irg
;
}
}
INLINE
void
INLINE
void
set_Start_irg
(
ir_node
*
node
,
ir_graph
*
irg
)
{
set_Start_irg
(
ir_node
*
node
,
ir_graph
*
irg
)
{
assert
(
node
->
op
==
op_Start
);
assert
(
node
->
op
==
op_Start
);
assert
(
is_ir_graph
(
irg
));
assert
(
is_ir_graph
(
irg
));
node
->
attr
.
start
.
irg
=
irg
;
assert
(
0
&&
" Why set irg? "
);
//node->attr.start.irg = irg;
}
}
INLINE
int
INLINE
int
...
@@ -725,14 +725,12 @@ free_End (ir_node *end) {
...
@@ -725,14 +725,12 @@ free_End (ir_node *end) {
in array afterwards ... */
in array afterwards ... */
}
}
ir_graph
*
get_EndReg_irg
(
const
ir_node
*
end
)
{
ir_graph
*
get_EndReg_irg
(
ir_node
*
end
)
{
assert
(
end
->
op
==
op_EndReg
);
return
get_irn_irg
(
end
);
return
end
->
attr
.
end
.
irg
;
}
}
ir_graph
*
get_EndExcept_irg
(
const
ir_node
*
end
)
{
ir_graph
*
get_EndExcept_irg
(
ir_node
*
end
)
{
assert
(
end
->
op
==
op_EndReg
);
return
get_irn_irg
(
end
);
return
end
->
attr
.
end
.
irg
;
}
}
/*
/*
...
@@ -1167,8 +1165,7 @@ void set_CallBegin_ptr (ir_node *node, ir_node *ptr) {
...
@@ -1167,8 +1165,7 @@ void set_CallBegin_ptr (ir_node *node, ir_node *ptr) {
set_irn_n
(
node
,
0
,
ptr
);
set_irn_n
(
node
,
0
,
ptr
);
}
}
ir_graph
*
get_CallBegin_irg
(
ir_node
*
node
)
{
ir_graph
*
get_CallBegin_irg
(
ir_node
*
node
)
{
assert
(
node
->
op
==
op_CallBegin
);
return
get_irn_irg
(
node
);
return
node
->
attr
.
callbegin
.
irg
;
}
}
ir_node
*
get_CallBegin_call
(
ir_node
*
node
)
{
ir_node
*
get_CallBegin_call
(
ir_node
*
node
)
{
assert
(
node
->
op
==
op_CallBegin
);
assert
(
node
->
op
==
op_CallBegin
);
...
@@ -2243,17 +2240,10 @@ ir_node *get_Filter_cg_pred(ir_node *node, int pos) {
...
@@ -2243,17 +2240,10 @@ ir_node *get_Filter_cg_pred(ir_node *node, int pos) {
INLINE
ir_graph
*
INLINE
ir_graph
*
get_irn_irg
(
ir_node
*
node
)
{
get_irn_irg
(
ir_node
*
node
)
{
if
(
get_irn_op
(
node
)
==
op_CallBegin
)
{
if
(
get_irn_op
(
node
)
!=
op_Block
)
return
node
->
attr
.
callbegin
.
irg
;
node
=
get_nodes_block
(
node
);
}
else
if
(
get_irn_op
(
node
)
==
op_EndReg
||
assert
(
get_irn_op
(
node
)
==
op_Block
);
get_irn_op
(
node
)
==
op_EndExcept
)
{
return
node
->
attr
.
block
.
irg
;
return
node
->
attr
.
end
.
irg
;
}
else
if
(
get_irn_op
(
node
)
==
op_Start
)
{
return
node
->
attr
.
start
.
irg
;
}
else
{
assert
(
0
&&
"no irg attr"
);
return
NULL
;
}
}
}
...
@@ -2361,17 +2351,7 @@ INLINE int is_ip_cfop(ir_node *node) {
...
@@ -2361,17 +2351,7 @@ INLINE int is_ip_cfop(ir_node *node) {
}
}
ir_graph
*
get_ip_cfop_irg
(
ir_node
*
n
)
{
ir_graph
*
get_ip_cfop_irg
(
ir_node
*
n
)
{
switch
(
get_irn_opcode
(
n
))
{
return
get_irn_irg
(
n
);
case
iro_EndReg
:
return
get_EndReg_irg
(
n
);
case
iro_EndExcept
:
return
get_EndExcept_irg
(
n
);
case
iro_CallBegin
:
return
get_CallBegin_irg
(
n
);
default:
assert
(
is_ip_cfop
(
n
));
}
return
NULL
;
/* should never be reached */
}
}
/* Returns true if the operation can change the control flow because
/* Returns true if the operation can change the control flow because
...
...
ir/ir/irnode.h
View file @
e8fda67a
...
@@ -146,17 +146,18 @@ INLINE void mark_irn_visited (ir_node *node);
...
@@ -146,17 +146,18 @@ INLINE void mark_irn_visited (ir_node *node);
INLINE
int
irn_not_visited
(
const
ir_node
*
node
);
INLINE
int
irn_not_visited
(
const
ir_node
*
node
);
/** Returns 1 if visited >= get_irg_visited(current_ir_graph). */
/** Returns 1 if visited >= get_irg_visited(current_ir_graph). */
INLINE
int
irn_visited
(
const
ir_node
*
node
);
INLINE
int
irn_visited
(
const
ir_node
*
node
);
INLINE
void
set_irn_link
(
ir_node
*
node
,
void
*
link
);
INLINE
void
set_irn_link
(
ir_node
*
node
,
void
*
link
);
INLINE
void
*
get_irn_link
(
const
ir_node
*
node
);
INLINE
void
*
get_irn_link
(
const
ir_node
*
node
);
/** Returns the ir_graph this node belongs to. Only valid if irg
* is in state pinned (irg is only stored in the block. */
INLINE
ir_graph
*
get_irn_irg
(
ir_node
*
node
);
/** Outputs a unique number for this node if libfirm is compiled for
/** Outputs a unique number for this node if libfirm is compiled for
debugging, (configure with --enable-debug) else returns address
debugging, (configure with --enable-debug) else returns address
of node cast to long. */
of node cast to long. */
INLINE
long
get_irn_node_nr
(
const
ir_node
*
node
);
INLINE
long
get_irn_node_nr
(
const
ir_node
*
node
);
/** Returns the ir_graph this node belongs to. Only valid for
* CallBegin, EndReg, EndExcept and Start */
INLINE
ir_graph
*
get_irn_irg
(
ir_node
*
node
);
/**
/**
* irnode constructor.
* irnode constructor.
...
@@ -258,9 +259,9 @@ ir_node *get_Block_cg_cfgpred(ir_node * node, int pos);
...
@@ -258,9 +259,9 @@ ir_node *get_Block_cg_cfgpred(ir_node * node, int pos);
/* frees the memory. */
/* frees the memory. */
void
remove_Block_cg_cfgpred_arr
(
ir_node
*
node
);
void
remove_Block_cg_cfgpred_arr
(
ir_node
*
node
);
/* Start references the irg it is in. */
/* Start references the irg it is in.
@@@ old -- use get_irn_irg instead! */
ir_graph
*
get_Start_irg
(
ir_node
*
node
);
ir_graph
*
get_Start_irg
(
ir_node
*
node
);
void
set_Start_irg
(
ir_node
*
node
,
ir_graph
*
irg
);
INLINE
int
get_End_n_keepalives
(
ir_node
*
end
);
INLINE
int
get_End_n_keepalives
(
ir_node
*
end
);
INLINE
ir_node
*
get_End_keepalive
(
ir_node
*
end
,
int
pos
);
INLINE
ir_node
*
get_End_keepalive
(
ir_node
*
end
,
int
pos
);
...
@@ -271,8 +272,9 @@ INLINE void set_End_keepalive(ir_node *end, int pos, ir_node *ka);
...
@@ -271,8 +272,9 @@ INLINE void set_End_keepalive(ir_node *end, int pos, ir_node *ka);
free_End frees these data structures. */
free_End frees these data structures. */
INLINE
void
free_End
(
ir_node
*
end
);
INLINE
void
free_End
(
ir_node
*
end
);
ir_graph
*
get_EndReg_irg
(
const
ir_node
*
end
);
/* @@@ old -- use get_irn_irg instead! */
ir_graph
*
get_EndExcept_irg
(
const
ir_node
*
end
);
ir_graph
*
get_EndReg_irg
(
ir_node
*
end
);
ir_graph
*
get_EndExcept_irg
(
ir_node
*
end
);
/* We distinguish three kinds of Cond nodes. These can be distinguished
/* We distinguish three kinds of Cond nodes. These can be distinguished
by the mode of the selector operand and an internal flag of type cond_kind.
by the mode of the selector operand and an internal flag of type cond_kind.
...
@@ -420,6 +422,7 @@ void remove_Call_callee_arr(ir_node * node);
...
@@ -420,6 +422,7 @@ void remove_Call_callee_arr(ir_node * node);
ir_node
*
get_CallBegin_ptr
(
ir_node
*
node
);
ir_node
*
get_CallBegin_ptr
(
ir_node
*
node
);
void
set_CallBegin_ptr
(
ir_node
*
node
,
ir_node
*
ptr
);
void
set_CallBegin_ptr
(
ir_node
*
node
,
ir_node
*
ptr
);
/* @@@ old -- use get_irn_irg instead! */
ir_graph
*
get_CallBegin_irg
(
ir_node
*
node
);
ir_graph
*
get_CallBegin_irg
(
ir_node
*
node
);
ir_node
*
get_CallBegin_call
(
ir_node
*
node
);
ir_node
*
get_CallBegin_call
(
ir_node
*
node
);
void
set_CallBegin_call
(
ir_node
*
node
,
ir_node
*
call
);
void
set_CallBegin_call
(
ir_node
*
node
,
ir_node
*
call
);
...
@@ -725,14 +728,15 @@ INLINE int is_Proj (const ir_node *node);
...
@@ -725,14 +728,15 @@ INLINE int is_Proj (const ir_node *node);
Start, End, Jmp, Cond, Return, Raise, Bad, CallBegin, EndReg, EndExcept */
Start, End, Jmp, Cond, Return, Raise, Bad, CallBegin, EndReg, EndExcept */
int
is_cfop
(
ir_node
*
node
);
int
is_cfop
(
ir_node
*
node
);
/* @@@ old -- use get_irn_irg instead! */
ir_graph
*
get_ip_cfop_irg
(
ir_node
*
n
);
/** Returns true if the operation manipulates interprocedural control flow:
/** Returns true if the operation manipulates interprocedural control flow:
CallBegin, EndReg, EndExcept */
CallBegin, EndReg, EndExcept */
int
is_ip_cfop
(
ir_node
*
node
);
int
is_ip_cfop
(
ir_node
*
node
);
/** Returns true if the operation can change the control flow because
/** Returns true if the operation can change the control flow because
of an exception: Call, Quot, DivMod, Div, Mod, Load, Store, Alloc,
of an exception: Call, Quot, DivMod, Div, Mod, Load, Store, Alloc,
Bad. */
Bad. */
ir_graph
*
get_ip_cfop_irg
(
ir_node
*
n
);
int
is_fragile_op
(
ir_node
*
node
);
int
is_fragile_op
(
ir_node
*
node
);
/** Returns the memory operand of fragile operations. */
/** Returns the memory operand of fragile operations. */
ir_node
*
get_fragile_op_mem
(
ir_node
*
node
);
ir_node
*
get_fragile_op_mem
(
ir_node
*
node
);
...
...
ir/ir/irnode_t.h
View file @
e8fda67a
...
@@ -39,29 +39,33 @@
...
@@ -39,29 +39,33 @@
/** Block attributes */
/** Block attributes */
typedef
struct
{
typedef
struct
{
/* General attributes */
ir_graph
*
irg
;
unsigned
long
block_visited
;
/**< for the walker that walks over all blocks. */
unsigned
long
block_visited
;
/**< for the walker that walks over all blocks. */
/* Attributes private to construction: */
/* Attributes private to construction: */
bool
matured
;
/**< if set, all in-nodes of the block are fixed */
bool
matured
;
/**< if set, all in-nodes of the block are fixed */
struct
ir_node
**
graph_arr
;
/**< array to store all parameters */
struct
ir_node
**
graph_arr
;
/**< array to store all parameters */
/* Attributes holding analyses information */
struct
dom_info
dom
;
/**< Datastructure that holds information about dominators.
struct
dom_info
dom
;
/**< Datastructure that holds information about dominators.
@todo
@@@
@todo
Eventually overlay with graph_arr as only valid
Eventually overlay with graph_arr as only valid
in different phases. Eventually inline the whole
in different phases. Eventually inline the whole
datastructure. */
datastructure. */
exc_t
exc
;
/**< role of this block for exception handling */
//
exc_t exc; /**< role of this block for exception handling */
ir_node
*
handler_entry
;
/**< handler entry block iff this block is part of a region */
//
ir_node *handler_entry; /**< handler entry block iff this block is part of a region */
ir_node
**
in_cg
;
/**< array with predecessors in
ir_node
**
in_cg
;
/**< array with predecessors in
* interprocedural_view, if they differ
* interprocedural_view, if they differ