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
2dc559c3
Commit
2dc559c3
authored
Apr 02, 2009
by
Moritz Kroll
Browse files
Renamed attr.cast.totype to attr.cast.type. Added Cast node to ir_spec.py
[r25766]
parent
932c8c14
Changes
5
Hide whitespace changes
Inline
Side-by-side
ir/ir/ircons.c
View file @
2dc559c3
...
...
@@ -349,6 +349,7 @@ new_bd_Conv(dbg_info *db, ir_node *block, ir_node *op, ir_mode *mode, int strict
return
res
;
}
/* new_bd_Conv */
#ifdef USE_ORIGINAL
static
ir_node
*
new_bd_Cast
(
dbg_info
*
db
,
ir_node
*
block
,
ir_node
*
op
,
ir_type
*
to_tp
)
{
ir_node
*
res
;
...
...
@@ -357,13 +358,12 @@ new_bd_Cast(dbg_info *db, ir_node *block, ir_node *op, ir_type *to_tp) {
assert
(
is_atomic_type
(
to_tp
));
res
=
new_ir_node
(
db
,
irg
,
block
,
op_Cast
,
get_irn_mode
(
op
),
1
,
&
op
);
res
->
attr
.
cast
.
to
type
=
to_tp
;
res
->
attr
.
cast
.
type
=
to_tp
;
res
=
optimize_node
(
res
);
IRN_VRFY_IRG
(
res
,
irg
);
return
res
;
}
/* new_bd_Cast */
#ifdef USE_ORIGINAL
static
ir_node
*
new_bd_Tuple
(
dbg_info
*
db
,
ir_node
*
block
,
int
arity
,
ir_node
**
in
)
{
ir_node
*
res
;
...
...
@@ -1044,6 +1044,7 @@ new_rd_strictConv(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op, ir_m
return
res
;
}
/* new_rd_strictConv */
#ifdef USE_ORIGINAL
ir_node
*
new_rd_Cast
(
dbg_info
*
db
,
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op
,
ir_type
*
to_tp
)
{
ir_node
*
res
;
...
...
@@ -1056,7 +1057,6 @@ new_rd_Cast(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op, ir_type *t
return
res
;
}
/* new_rd_Cast */
#ifdef USE_ORIGINAL
ir_node
*
new_rd_Tuple
(
dbg_info
*
db
,
ir_graph
*
irg
,
ir_node
*
block
,
int
arity
,
ir_node
**
in
)
{
ir_node
*
res
;
...
...
@@ -1683,14 +1683,14 @@ ir_node *new_r_strictConv(ir_graph *irg, ir_node *block,
ir_node
*
op
,
ir_mode
*
mode
)
{
return
new_rd_strictConv
(
NULL
,
irg
,
block
,
op
,
mode
);
}
ir_node
*
new_r_Cast
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op
,
ir_type
*
to_tp
)
{
return
new_rd_Cast
(
NULL
,
irg
,
block
,
op
,
to_tp
);
}
ir_node
*
new_r_Phi
(
ir_graph
*
irg
,
ir_node
*
block
,
int
arity
,
ir_node
**
in
,
ir_mode
*
mode
)
{
return
new_rd_Phi
(
NULL
,
irg
,
block
,
arity
,
in
,
mode
);
}
#ifdef USE_ORIGINAL
ir_node
*
new_r_Cast
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
op
,
ir_type
*
to_tp
)
{
return
new_rd_Cast
(
NULL
,
irg
,
block
,
op
,
to_tp
);
}
ir_node
*
new_r_Load
(
ir_graph
*
irg
,
ir_node
*
block
,
ir_node
*
store
,
ir_node
*
adr
,
ir_mode
*
mode
,
ir_cons_flags
flags
)
{
return
new_rd_Load
(
NULL
,
irg
,
block
,
store
,
adr
,
mode
,
flags
);
...
...
@@ -2447,12 +2447,12 @@ new_d_strictConv(dbg_info *db, ir_node *op, ir_mode *mode) {
return
new_bd_Conv
(
db
,
current_ir_graph
->
current_block
,
op
,
mode
,
1
);
}
/* new_d_strictConv */
#ifdef USE_ORIGINAL
ir_node
*
new_d_Cast
(
dbg_info
*
db
,
ir_node
*
op
,
ir_type
*
to_tp
)
{
return
new_bd_Cast
(
db
,
current_ir_graph
->
current_block
,
op
,
to_tp
);
}
/* new_d_Cast */
#ifdef USE_ORIGINAL
ir_node
*
new_d_Tuple
(
dbg_info
*
db
,
int
arity
,
ir_node
**
in
)
{
return
new_bd_Tuple
(
db
,
current_ir_graph
->
current_block
,
arity
,
in
);
...
...
@@ -3130,13 +3130,13 @@ ir_node *new_Conv(ir_node *op, ir_mode *mode) {
ir_node
*
new_strictConv
(
ir_node
*
op
,
ir_mode
*
mode
)
{
return
new_d_strictConv
(
NULL
,
op
,
mode
);
}
ir_node
*
new_Cast
(
ir_node
*
op
,
ir_type
*
to_tp
)
{
return
new_d_Cast
(
NULL
,
op
,
to_tp
);
}
ir_node
*
new_Phi
(
int
arity
,
ir_node
**
in
,
ir_mode
*
mode
)
{
return
new_d_Phi
(
NULL
,
arity
,
in
,
mode
);
}
#ifdef USE_ORIGINAL
ir_node
*
new_Cast
(
ir_node
*
op
,
ir_type
*
to_tp
)
{
return
new_d_Cast
(
NULL
,
op
,
to_tp
);
}
ir_node
*
new_Load
(
ir_node
*
store
,
ir_node
*
addr
,
ir_mode
*
mode
,
ir_cons_flags
flags
)
{
return
new_d_Load
(
NULL
,
store
,
addr
,
mode
,
flags
);
}
...
...
ir/ir/irnode.c
View file @
2dc559c3
...
...
@@ -1627,14 +1627,14 @@ void set_Conv_strict(ir_node *node, int strict_flag) {
ir_type
*
get_Cast_type
(
ir_node
*
node
)
{
assert
(
is_Cast
(
node
));
node
->
attr
.
cast
.
to
type
=
skip_tid
(
node
->
attr
.
cast
.
to
type
);
return
node
->
attr
.
cast
.
to
type
;
node
->
attr
.
cast
.
type
=
skip_tid
(
node
->
attr
.
cast
.
type
);
return
node
->
attr
.
cast
.
type
;
}
void
set_Cast_type
(
ir_node
*
node
,
ir_type
*
to_tp
)
{
assert
(
is_Cast
(
node
));
node
->
attr
.
cast
.
to
type
=
to_tp
;
node
->
attr
.
cast
.
type
=
to_tp
;
}
...
...
ir/ir/irtypes.h
View file @
2dc559c3
...
...
@@ -234,7 +234,7 @@ typedef struct {
/** Cast attributes. */
typedef
struct
{
ir_type
*
to
type
;
/**< Type of the casted node. */
ir_type
*
type
;
/**< Type of the casted node. */
}
cast_attr
;
/** Load attributes. */
...
...
scripts/gen_ir.py
View file @
2dc559c3
...
...
@@ -289,7 +289,7 @@ def main(argv):
# List of TODOs
niymap
=
[
"Alloc"
,
"Anchor"
,
"ASM"
,
"Bad"
,
"Bound"
,
"Break"
,
"Builtin"
,
"Call"
,
"CallBegin"
,
"Cast"
,
"Const"
,
"Const_type"
,
"Const_long"
,
"CopyB"
,
"Call"
,
"CallBegin"
,
"Const"
,
"Const_type"
,
"Const_long"
,
"CopyB"
,
"defaultProj"
,
"Div"
,
"DivRL"
,
"DivMod"
,
"Dummy"
,
"EndReg"
,
"EndExcept"
,
"Filter"
,
"InstOf"
,
"Mod"
,
"NoMem"
,
"Phi"
,
"Quot"
,
"Raise"
,
"simpleSel"
,
"strictConv"
,
"SymConst"
,
"SymConst_type"
,
"Sync"
]
...
...
scripts/ir_spec.py
View file @
2dc559c3
...
...
@@ -170,6 +170,18 @@ Carry = dict(
is_a
=
"binop"
),
Cast
=
dict
(
ins
=
[
"op"
],
mode
=
"get_irn_mode(irn_op)"
,
attrs
=
[
dict
(
type
=
"ir_type*"
,
name
=
"type"
)
],
init
=
"assert(is_atomic_type(type));"
),
Cmp
=
dict
(
is_a
=
"binop"
,
outs
=
[
"False"
,
"Eq"
,
"Lt"
,
"Le"
,
"Gt"
,
"Ge"
,
"Lg"
,
"Leg"
,
"Uo"
,
"Ue"
,
"Ul"
,
"Ule"
,
"Ug"
,
"Uge"
,
"Ne"
,
"True"
],
...
...
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