From 04b9ac73fc2d22a7dfa442207fe8c9c70382112f Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 10 Dec 2007 18:46:22 +0000 Subject: [PATCH] Count all local _scalar_ declarations for the local variable limit. [r18655] --- ast2firm.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ast2firm.c b/ast2firm.c index 78f3f6e..975e292 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -3528,16 +3528,8 @@ static int count_local_declarations(const declaration_t * decl, int count = 0; for (; decl != end; decl = decl->next) { const type_t *type = skip_typeref(decl->type); - switch (type->kind) { - case TYPE_ATOMIC: - case TYPE_ENUM: - case TYPE_POINTER: - if (!decl->address_taken) - ++count; - break; - - default: break; - } + if (!decl->address_taken && is_type_scalar(type)) + ++count; const initializer_t *initializer = decl->init.initializer; /* FIXME: should walk initializer hierarchies... */ if(initializer != NULL && initializer->kind == INITIALIZER_VALUE) { -- 2.20.1