improve declaration counter
authorMatthias Braun <matze@braunis.de>
Fri, 28 Dec 2007 19:22:20 +0000 (19:22 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 28 Dec 2007 19:22:20 +0000 (19:22 +0000)
[r18822]

ast2firm.c

index 714e013..ce26eb9 100644 (file)
@@ -3841,6 +3841,14 @@ static int count_decls_in_expression(const expression_t *expression) {
        }
        EXPR_UNARY_CASES
                return count_decls_in_expression(expression->unary.value);
+       case EXPR_CALL: {
+               int count = 0;
+               call_argument_t *argument = expression->call.arguments;
+               for( ; argument != NULL; argument = argument->next) {
+                       count += count_decls_in_expression(argument->expression);
+               }
+               return count;
+       }
 
        default:
                break;