tree2scop.c: tree_is_decl: do not treat empty block as group of declarations
commit285e4a47c73e7e6fd66b206585e91f74739bbd90
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 7 Nov 2016 09:00:33 +0000 (7 10:00 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 7 Nov 2016 09:09:35 +0000 (7 10:09 +0100)
treecdda2df41677d3b1df129527f9ee857cfcd07b2b
parentbc006783f0cb1f068e5251e01f89df3b29aa3ae7
tree2scop.c: tree_is_decl: do not treat empty block as group of declarations

A block was being treated as a group of declarations if all
its elements are declarations, including the case where
the block has no elements.  Do not treat such empty blocks
as a group of declarations.

This improves support for empty statements since a block of code
consisting of only empty statements results in an empty pet_tree_block,
which would then mistakenly get treated as a group of declarations.

Reported-by: Samuel Thibault <samuel.thibault@inria.fr>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
tests/empty3.c [new file with mode: 0644]
tests/empty3.scop [new file with mode: 0644]
tree2scop.c