summaryrefslogtreecommitdiffhomepage
path: root/ir/tr
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-06-25 08:19:35 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-06-27 06:09:18 +0200
commitf6330956c9f0bc787f1903bffa1700394527c742 (patch)
treec7253aa7e8cff3e3ed96efd6fc3715c5b523db3c /ir/tr
parentcdd69f9f04e2fac0629bafb87b77110e01a793c9 (diff)
Remove 'tf_variable_size'.
Just check that the size of the array is 0 instead.
Diffstat (limited to 'ir/tr')
-rw-r--r--ir/tr/type.c33
-rw-r--r--ir/tr/type_t.h3
2 files changed, 4 insertions, 32 deletions
diff --git a/ir/tr/type.c b/ir/tr/type.c
index b6b0f83..17555b1 100644
--- a/ir/tr/type.c
+++ b/ir/tr/type.c
@@ -782,19 +782,6 @@ ir_type *get_array_element_type(const ir_type *array)
return array->attr.array.element_type;
}
-int is_array_variable_size(const ir_type *array)
-{
- assert(is_Array_type(array));
- return (array->flags & tf_variable_size) != 0;
-}
-
-void set_array_variable_size(ir_type *array, int flag)
-{
- assert(is_Array_type(array));
- array->flags = (array->flags & ~tf_variable_size)
- | (flag != 0 ? tf_variable_size : 0);
-}
-
int (is_Array_type)(const ir_type *array)
{
return is_array_type_(array);
@@ -887,19 +874,6 @@ size_t get_compound_member_index(ir_type const *const type,
return INVALID_MEMBER_INDEX;
}
-void set_compound_variable_size(ir_type *tp, int variable_size_flag)
-{
- assert(is_compound_type(tp));
- tp->flags = (tp->flags & ~tf_variable_size)
- | (variable_size_flag != 0 ? tf_variable_size : 0);
-}
-
-int is_compound_variable_size(const ir_type *tp)
-{
- assert(is_compound_type(tp));
- return (tp->flags & tf_variable_size) != 0;
-}
-
int is_compound_type(const ir_type *tp)
{
assert(tp->kind == k_type);
@@ -999,7 +973,6 @@ void default_layout_compound_type(ir_type *type)
{
unsigned size = 0;
unsigned align_all = 1;
- bool var_size = is_compound_variable_size(type);
for (size_t i = 0, n = get_compound_n_members(type); i < n; ++i) {
ir_entity *entity = get_compound_member(type, i);
ir_type *entity_type = get_entity_type(entity);
@@ -1011,11 +984,11 @@ void default_layout_compound_type(ir_type *type)
}
unsigned entity_size;
- if (i+1 < n || !var_size) {
+ if (i + 1 == n && is_Array_type(entity_type) && get_array_size(entity_type) == 0) {
+ entity_size = 0;
+ } else {
assert(get_type_state(entity_type) == layout_fixed);
entity_size = get_type_size(entity_type);
- } else {
- entity_size = 0;
}
unsigned const align = get_type_alignment(entity_type);
diff --git a/ir/tr/type_t.h b/ir/tr/type_t.h
index 6a15300..a5cc6a3 100644
--- a/ir/tr/type_t.h
+++ b/ir/tr/type_t.h
@@ -94,8 +94,7 @@ typedef enum type_flags {
tf_frame_type = 1U << 3, /**< Set if this is a frame type. */
tf_info = 1U << 4, /**< infos (for example constructor, destructor pointers), all members are anonymous */
- tf_variable_size = 1U << 5, /**< compound or array type may have variable size last element */
- tf_lowered_dw = 1U << 6, /**< hack to identify lowered doubleword params */
+ tf_lowered_dw = 1U << 5, /**< hack to identify lowered doubleword params */
} type_flags;
ENUM_BITSET(type_flags)