decl.c (gnat_to_gnu_param): Minor tweak.
commit718364340fa052641189523e41a5006ba6c9966d
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 7 Jul 2018 10:06:08 +0000 (7 10:06 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 7 Jul 2018 10:06:08 +0000 (7 10:06 +0000)
tree570d31e7786608bb116879802c177ebeb03e7bd4
parent4a669ac35988fa6de5931455fb59c713563bc58b
decl.c (gnat_to_gnu_param): Minor tweak.

* gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
(gnat_to_gnu_subprog_type): New pure_flag local variable.  Set it for
a pure Ada function with a by-ref In parameter.  Propagate it onto the
function type by means of the TYPE_QUAL_RESTRICT flag.
* gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
function type has the TYPE_QUAL_RESTRICT flag set.

From-SVN: r262495
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/utils.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/pure_function3_pkg.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/pure_function3a.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/pure_function3b.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/pure_function3c.adb [new file with mode: 0644]