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
2028883f
Commit
2028883f
authored
Dec 06, 2015
by
Matthias Braun
Browse files
unify compound type code
parent
87fe2cba
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/tr/tpop.c
View file @
2028883f
...
...
@@ -44,7 +44,7 @@ static const tp_op_ops
/** tpop operations for class types */
class_ops
=
{
.
free_attrs
=
free_class_attrs
,
.
free_entities
=
free_c
lass
_entities
,
.
free_entities
=
free_c
ompound
_entities
,
.
set_type_mode
=
set_class_mode
,
.
set_type_size
=
set_default_size
,
.
get_n_members
=
get_class_n_members
,
...
...
@@ -54,7 +54,7 @@ static const tp_op_ops
/** tpop operations for struct types */
struct_ops
=
{
.
free_attrs
=
free_struct_attrs
,
.
free_entities
=
free_
struct
_entities
,
.
free_entities
=
free_
compound
_entities
,
.
set_type_mode
=
set_struct_mode
,
.
set_type_size
=
set_default_size
,
.
get_n_members
=
get_struct_n_members
,
...
...
@@ -68,7 +68,7 @@ static const tp_op_ops
/** tpop operations for union types */
union_ops
=
{
.
free_attrs
=
free_union_attrs
,
.
free_entities
=
free_
union
_entities
,
.
free_entities
=
free_
compound
_entities
,
.
set_type_size
=
set_default_size
,
.
get_n_members
=
get_union_n_members
,
.
get_member
=
get_union_member
,
...
...
ir/tr/type.c
View file @
2028883f
...
...
@@ -365,7 +365,7 @@ static void compound_add_member(ir_type *type, ir_entity *entity)
ARR_APP1
(
ir_entity
*
,
type
->
attr
.
ca
.
members
,
entity
);
}
static
void
compound_
free_
entities
(
ir_type
*
type
)
void
free_
compound_entities
(
ir_type
*
type
)
{
for
(
size_t
i
=
compound_get_n_members
(
type
);
i
--
>
0
;
)
free_entity
(
compound_get_member
(
type
,
i
));
...
...
@@ -403,12 +403,6 @@ ir_type *new_type_class(ident *name)
return
res
;
}
void
free_class_entities
(
ir_type
*
clss
)
{
assert
(
is_Class_type
(
clss
));
compound_free_entities
(
clss
);
}
void
free_class_attrs
(
ir_type
*
clss
)
{
assert
(
is_Class_type
(
clss
));
...
...
@@ -595,12 +589,6 @@ ir_type *new_type_struct(ident *name)
return
res
;
}
void
free_struct_entities
(
ir_type
*
strct
)
{
assert
(
is_Struct_type
(
strct
));
compound_free_entities
(
strct
);
}
void
free_struct_attrs
(
ir_type
*
strct
)
{
assert
(
is_Struct_type
(
strct
));
...
...
@@ -823,12 +811,6 @@ ir_type *new_type_union(ident *name)
return
res
;
}
void
free_union_entities
(
ir_type
*
uni
)
{
assert
(
is_Union_type
(
uni
));
compound_free_entities
(
uni
);
}
void
free_union_attrs
(
ir_type
*
uni
)
{
assert
(
is_Union_type
(
uni
));
...
...
ir/tr/type_t.h
View file @
2028883f
...
...
@@ -153,9 +153,7 @@ struct ir_type {
void
free_type_entities
(
ir_type
*
tp
);
void
free_class_entities
(
ir_type
*
clss
);
void
free_struct_entities
(
ir_type
*
strct
);
void
free_union_entities
(
ir_type
*
uni
);
void
free_compound_entities
(
ir_type
*
type
);
void
free_class_attrs
(
ir_type
*
clss
);
void
free_struct_attrs
(
ir_type
*
strct
);
...
...
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