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
2b9dfcb0
Commit
2b9dfcb0
authored
Dec 06, 2015
by
Matthias Braun
Browse files
No need to dispatch set_type_size through tpop
parent
30d44f48
Changes
4
Hide whitespace changes
Inline
Side-by-side
ir/tr/tpop.c
View file @
2b9dfcb0
...
...
@@ -45,13 +45,11 @@ static const tp_op_ops
class_ops
=
{
.
free_attrs
=
free_class_attrs
,
.
free_entities
=
free_compound_entities
,
.
set_type_size
=
set_default_size
,
},
/** tpop operations for struct types */
struct_ops
=
{
.
free_attrs
=
free_struct_attrs
,
.
free_entities
=
free_compound_entities
,
.
set_type_size
=
set_default_size
,
},
/** tpop operations for method types */
method_ops
=
{
...
...
@@ -61,14 +59,6 @@ static const tp_op_ops
union_ops
=
{
.
free_attrs
=
free_union_attrs
,
.
free_entities
=
free_compound_entities
,
.
set_type_size
=
set_default_size
,
},
/** tpop operations for array types */
array_ops
=
{
.
set_type_size
=
set_default_size
,
},
primitive_ops
=
{
.
set_type_size
=
set_default_size
,
},
null_ops
=
{
.
free_attrs
=
NULL
,
...
...
@@ -81,9 +71,9 @@ void init_tpop(void)
type_struct
=
new_tpop
(
tpo_struct
,
NEW_IDENT
(
"struct"
),
TP_OP_FLAG_COMPOUND
,
sizeof
(
compound_attr
),
&
struct_ops
);
type_method
=
new_tpop
(
tpo_method
,
NEW_IDENT
(
"method"
),
0
,
sizeof
(
mtd_attr
),
&
method_ops
);
type_union
=
new_tpop
(
tpo_union
,
NEW_IDENT
(
"union"
),
TP_OP_FLAG_COMPOUND
,
sizeof
(
compound_attr
),
&
union_ops
);
type_array
=
new_tpop
(
tpo_array
,
NEW_IDENT
(
"array"
),
0
,
sizeof
(
arr_attr
),
&
array
_ops
);
type_array
=
new_tpop
(
tpo_array
,
NEW_IDENT
(
"array"
),
0
,
sizeof
(
arr_attr
),
&
null
_ops
);
type_pointer
=
new_tpop
(
tpo_pointer
,
NEW_IDENT
(
"pointer"
),
0
,
sizeof
(
ptr_attr
),
&
null_ops
);
type_primitive
=
new_tpop
(
tpo_primitive
,
NEW_IDENT
(
"primitive"
),
0
,
0
,
&
primitive
_ops
);
type_primitive
=
new_tpop
(
tpo_primitive
,
NEW_IDENT
(
"primitive"
),
0
,
0
,
&
null
_ops
);
tpop_code
=
new_tpop
(
tpo_code
,
NEW_IDENT
(
"code"
),
0
,
0
,
&
null_ops
);
tpop_unknown
=
new_tpop
(
tpo_unknown
,
NEW_IDENT
(
"Unknown"
),
0
,
0
,
&
null_ops
);
}
...
...
ir/tr/tpop_t.h
View file @
2b9dfcb0
...
...
@@ -27,8 +27,6 @@ typedef struct tp_op_ops {
void
(
*
free_attrs
)(
ir_type
*
type
);
/** Called to free the owned entities of a type. */
void
(
*
free_entities
)(
ir_type
*
type
);
/** Called to set the byte size of a type. */
void
(
*
set_type_size
)(
ir_type
*
type
,
unsigned
size
);
}
tp_op_ops
;
/** possible flags for a type opcode */
...
...
ir/tr/type.c
View file @
2b9dfcb0
...
...
@@ -222,8 +222,7 @@ void set_type_visibility(ir_type *tp, ir_visibility v)
void
set_type_size_bytes
(
ir_type
*
tp
,
unsigned
size
)
{
const
tp_op
*
tpop
=
get_type_tpop
(
tp
);
tpop
->
ops
.
set_type_size
(
tp
,
size
);
tp
->
size
=
size
;
}
unsigned
(
get_type_alignment_bytes
)(
const
ir_type
*
type
)
...
...
@@ -1083,11 +1082,6 @@ ir_type *clone_frame_type(ir_type *type)
return
res
;
}
void
set_default_size
(
ir_type
*
tp
,
unsigned
size
)
{
tp
->
size
=
size
;
}
void
default_layout_compound_type
(
ir_type
*
type
)
{
unsigned
size
=
0
;
...
...
ir/tr/type_t.h
View file @
2b9dfcb0
...
...
@@ -160,8 +160,6 @@ void free_struct_attrs(ir_type *strct);
void
free_method_attrs
(
ir_type
*
method
);
void
free_union_attrs
(
ir_type
*
uni
);
void
set_default_size
(
ir_type
*
tp
,
unsigned
bytes
);
void
add_compound_member
(
ir_type
*
compound
,
ir_entity
*
entity
);
/** Initialize the type module. */
...
...
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