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
e6fe1244
Commit
e6fe1244
authored
Mar 03, 2010
by
Matthias Braun
Browse files
alloc has a count not a size argument, reflect this in method names
[r27254]
parent
ca21c59e
Changes
6
Hide whitespace changes
Inline
Side-by-side
include/libfirm/irnode.h
View file @
e6fe1244
...
...
@@ -969,8 +969,8 @@ typedef enum {
ir_node
*
get_Alloc_mem
(
const
ir_node
*
node
);
void
set_Alloc_mem
(
ir_node
*
node
,
ir_node
*
mem
);
ir_node
*
get_Alloc_
size
(
const
ir_node
*
node
);
void
set_Alloc_
size
(
ir_node
*
node
,
ir_node
*
size
);
ir_node
*
get_Alloc_
count
(
const
ir_node
*
node
);
void
set_Alloc_
count
(
ir_node
*
node
,
ir_node
*
count
);
ir_type
*
get_Alloc_type
(
ir_node
*
node
);
void
set_Alloc_type
(
ir_node
*
node
,
ir_type
*
tp
);
...
...
ir/be/beabi.c
View file @
e6fe1244
...
...
@@ -888,7 +888,11 @@ static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp
dbg_info
*
dbg
;
const
ir_edge_t
*
edge
;
ir_node
*
new_alloc
,
*
size
,
*
addr
,
*
ins
[
2
];
ir_node
*
new_alloc
;
ir_node
*
count
;
ir_node
*
size
;
ir_node
*
addr
;
ir_node
*
ins
[
2
];
unsigned
stack_alignment
;
assert
(
get_Alloc_where
(
alloc
)
==
stack_alloc
);
...
...
@@ -923,16 +927,18 @@ static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp
return
curr_sp
;
}
dbg
=
get_irn_dbg_info
(
alloc
);
size
=
get_Alloc_
size
(
alloc
);
dbg
=
get_irn_dbg_info
(
alloc
);
count
=
get_Alloc_
count
(
alloc
);
/* we might need to multiply the
size
with the element size */
/* we might need to multiply the
count
with the element size */
if
(
type
!=
firm_unknown_type
&&
get_type_size_bytes
(
type
)
!=
1
)
{
ir_mode
*
mode
=
get_irn_mode
(
size
);
ir_mode
*
mode
=
get_irn_mode
(
count
);
tarval
*
tv
=
new_tarval_from_long
(
get_type_size_bytes
(
type
),
mode
);
ir_node
*
cnst
=
new_rd_Const
(
dbg
,
irg
,
tv
);
size
=
new_rd_Mul
(
dbg
,
block
,
size
,
cnst
,
mode
);
size
=
new_rd_Mul
(
dbg
,
block
,
count
,
cnst
,
mode
);
}
else
{
size
=
count
;
}
/* The stack pointer will be modified in an unknown manner.
...
...
ir/ir/irnode.c
View file @
e6fe1244
...
...
@@ -2054,16 +2054,16 @@ void set_Alloc_mem(ir_node *node, ir_node *mem)
set_irn_n
(
node
,
0
,
mem
);
}
ir_node
*
get_Alloc_
size
(
const
ir_node
*
node
)
ir_node
*
get_Alloc_
count
(
const
ir_node
*
node
)
{
assert
(
is_Alloc
(
node
));
return
get_irn_n
(
node
,
1
);
}
void
set_Alloc_
size
(
ir_node
*
node
,
ir_node
*
size
)
void
set_Alloc_
count
(
ir_node
*
node
,
ir_node
*
count
)
{
assert
(
is_Alloc
(
node
));
set_irn_n
(
node
,
1
,
size
);
set_irn_n
(
node
,
1
,
count
);
}
ir_type
*
get_Alloc_type
(
ir_node
*
node
)
...
...
ir/ir/irvrfy.c
View file @
e6fe1244
...
...
@@ -1791,7 +1791,7 @@ static int verify_node_Alloc(ir_node *n, ir_graph *irg)
{
ir_mode
*
mymode
=
get_irn_mode
(
n
);
ir_mode
*
op1mode
=
get_irn_mode
(
get_Alloc_mem
(
n
));
ir_mode
*
op2mode
=
get_irn_mode
(
get_Alloc_
size
(
n
));
ir_mode
*
op2mode
=
get_irn_mode
(
get_Alloc_
count
(
n
));
(
void
)
irg
;
ASSERT_AND_RET_DBG
(
...
...
ir/opt/escape_ana.c
View file @
e6fe1244
...
...
@@ -404,7 +404,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env)
ftp
=
get_irg_frame_type
(
irg
);
for
(
alloc
=
env
->
found_allocs
;
alloc
;
alloc
=
next
)
{
next
=
get_irn_link
(
alloc
);
size
=
get_Alloc_
size
(
alloc
);
size
=
get_Alloc_
count
(
alloc
);
atp
=
get_Alloc_type
(
alloc
);
tp
=
NULL
;
...
...
scripts/ir_spec.py
View file @
e6fe1244
...
...
@@ -27,7 +27,7 @@ class Add(Binop):
flags
=
[
"commutative"
]
class
Alloc
(
Op
):
ins
=
[
"mem"
,
"
size
"
]
ins
=
[
"mem"
,
"
count
"
]
outs
=
[
"M"
,
"X_regular"
,
"X_except"
,
"res"
]
flags
=
[
"fragile"
,
"uses_memory"
]
attrs
=
[
...
...
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