Ignore type declarations when handling local variables.
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 11 Dec 2007 21:11:30 +0000 (21:11 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 11 Dec 2007 21:11:30 +0000 (21:11 +0000)
[r18680]

ast2firm.c

index 8348eca..22b2e83 100644 (file)
@@ -3112,6 +3112,8 @@ static void declaration_statement_to_firm(declaration_statement_t *statement)
        declaration_t *declaration = statement->declarations_begin;
        declaration_t *end         = statement->declarations_end->next;
        for( ; declaration != end; declaration = declaration->next) {
+               if(declaration->namespc != NAMESPACE_NORMAL)
+                       continue;
                create_local_variable(declaration);
        }
 }
@@ -3645,6 +3647,8 @@ static int count_local_declarations(const declaration_t *      decl,
 {
        int count = 0;
        for (; decl != end; decl = decl->next) {
+               if(decl->namespc != NAMESPACE_NORMAL)
+                       continue;
                const type_t *type = skip_typeref(decl->type);
                if (!decl->address_taken && is_type_scalar(type))
                        ++count;