summaryrefslogtreecommitdiffhomepage
path: root/ir/be/begnuas.c
diff options
context:
space:
mode:
authorAndreas Zwinkau <zwinkau@kit.edu>2016-01-14 16:28:19 +0100
committerAndreas Zwinkau <zwinkau@kit.edu>2016-01-14 16:29:08 +0100
commitccc99db0dcaafcd4bf32f378bfe555a6d9a7cdd0 (patch)
tree28682a0d18c5272f90cf08f9b5ec1236cc50f8bb /ir/be/begnuas.c
parent493826e29bda93cfd10d66c0e7175405054e9169 (diff)
refactor: lazy get_type_size_bytes call
Diffstat (limited to 'ir/be/begnuas.c')
-rw-r--r--ir/be/begnuas.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ir/be/begnuas.c b/ir/be/begnuas.c
index 6cd6f14..1b865ee 100644
--- a/ir/be/begnuas.c
+++ b/ir/be/begnuas.c
@@ -934,13 +934,13 @@ static size_t get_initializer_size(const ir_initializer_t *initializer,
static unsigned long compute_entity_size(ir_entity const *const entity)
{
ir_type *const type = get_entity_type(entity);
- unsigned long size = get_type_size_bytes(type);
if (is_alias_entity(entity))
- return size;
+ return get_type_size_bytes(type);
/* Note that for variable array/compound types we may have to inspect the
* initializer to get the actual size */
ir_initializer_t const *const initializer = get_entity_initializer(entity);
+ unsigned long size = 0;
if (initializer != NULL)
size = get_initializer_size(initializer, type);
return size;