isl_ast_node_print: avoid duplicate declarations in printed code
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 29 Mar 2013 13:53:13 +0000 (14:53 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 7 Apr 2013 15:33:09 +0000 (17:33 +0200)
commitaa7b5cfe601366e53f9bc5e19c4f61badb557f8d
tree7ba0bac44846a272982bf4cd7b089cfcc50a6383
parent6d7369db3eba0d08285b9ea367346a74a52dc8c0
isl_ast_node_print: avoid duplicate declarations in printed code

If a loop has only one iteration but if the expression
for this single iteration is too complicated to be substituted into the AST,
then the expression is assigned to a variable corresponding to the loop
iterator.
If two such loops occur in the same block, then we would end up with
two declarations of the same variable.  Avoid this problem by introducing
a block around the declaration if it appears in a sequence of statements.

Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast.c
test_inputs/codegen/unroll4.c [new file with mode: 0644]
test_inputs/codegen/unroll4.in [new file with mode: 0644]