support inlining of outermost call expressions
commit253cd82652ef9d79f0a3ec24ca7f06615e60db93
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 11 Aug 2015 12:10:38 +0000 (11 14:10 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 10 Nov 2015 11:05:22 +0000 (10 12:05 +0100)
tree5db63f6472a436346c616bf83d47ed49a4c464bf
parente49f07c7761ad62d260c7d1e4cb095f5f894ea02
support inlining of outermost call expressions

In particular, any expression statement of which the outer expression
is a call to a function, the definition of which is marked "inline",
is replaced by an inlined copy of the called function.
Calls that appear as subexpressions are not inlined because
that would require support for return statements.

The inlining is performed at the level of (unevaluated) pet_trees
to ensure a consistent view of what variables are considered parameters.

The inlining is performed by assigning the scalar arguments and
the indices of the array arguments to temporary variables and
replacing the corresponding formal arguments in the tree extracted
from the function body by expression referring to or containing
these temporary variables.  The regular evaluation mechanism
is then used to propagate the scalar values whenever feasible.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
20 files changed:
scan.cc
scan.h
tests/inline1.c [new file with mode: 0644]
tests/inline1.scop [new file with mode: 0644]
tests/inline2.c [new file with mode: 0644]
tests/inline2.scop [new file with mode: 0644]
tests/inline3.c [new file with mode: 0644]
tests/inline3.scop [new file with mode: 0644]
tests/inline4.c [new file with mode: 0644]
tests/inline4.scop [new file with mode: 0644]
tests/inline5.c [new file with mode: 0644]
tests/inline5.scop [new file with mode: 0644]
tests/inline6.c [new file with mode: 0644]
tests/inline6.scop [new file with mode: 0644]
tests/inline7.c [new file with mode: 0644]
tests/inline7.scop [new file with mode: 0644]
tests/inline8.c [new file with mode: 0644]
tests/inline8.scop [new file with mode: 0644]
tests/inline9.c [new file with mode: 0644]
tests/inline9.scop [new file with mode: 0644]