From: Christoph Mallon Date: Sat, 10 Sep 2011 10:16:32 +0000 (+0200) Subject: The typeof-type is always set, no need to check and use the expression's type as... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=71a57e47071dbc23a47ef771936b8333c5f6d758;p=cparser The typeof-type is always set, no need to check and use the expression's type as fallback. --- diff --git a/type.c b/type.c index b7a5b6d..46cb071 100644 --- a/type.c +++ b/type.c @@ -1213,11 +1213,7 @@ unsigned get_type_size(type_t *type) case TYPE_TYPEDEF: return get_type_size(type->typedeft.typedefe->type); case TYPE_TYPEOF: - if (type->typeoft.typeof_type) { - return get_type_size(type->typeoft.typeof_type); - } else { - return get_type_size(type->typeoft.expression->base.type); - } + return get_type_size(type->typeoft.typeof_type); } panic("invalid type in get_type_size"); } @@ -1255,11 +1251,7 @@ unsigned get_type_alignment(type_t *type) return alignment; } case TYPE_TYPEOF: - if (type->typeoft.typeof_type) { - return get_type_alignment(type->typeoft.typeof_type); - } else { - return get_type_alignment(type->typeoft.expression->base.type); - } + return get_type_alignment(type->typeoft.typeof_type); } panic("invalid type in get_type_alignment"); } @@ -1301,11 +1293,7 @@ decl_modifiers_t get_type_modifiers(const type_t *type) return modifiers; } case TYPE_TYPEOF: - if (type->typeoft.typeof_type) { - return get_type_modifiers(type->typeoft.typeof_type); - } else { - return get_type_modifiers(type->typeoft.expression->base.type); - } + return get_type_modifiers(type->typeoft.typeof_type); } panic("invalid type found in get_type_modifiers"); }