aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-07-07 10:06:08 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-07-07 10:06:08 +0000
commit718364340fa052641189523e41a5006ba6c9966d (patch)
tree570d31e7786608bb116879802c177ebeb03e7bd4 /gcc/ada/gcc-interface/utils.c
parent4a669ac35988fa6de5931455fb59c713563bc58b (diff)
downloadgcc-718364340fa052641189523e41a5006ba6c9966d.zip
gcc-718364340fa052641189523e41a5006ba6c9966d.tar.gz
gcc-718364340fa052641189523e41a5006ba6c9966d.tar.bz2
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
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index e456cc6..e0e5cfe 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -3330,6 +3330,9 @@ finish_subprog_decl (tree decl, tree asm_name, tree type)
/* Propagate the "const" property. */
TREE_READONLY (decl) = TYPE_READONLY (type);
+ /* Propagate the "pure" property. */
+ DECL_PURE_P (decl) = TYPE_RESTRICT (type);
+
/* Propagate the "noreturn" property. */
TREE_THIS_VOLATILE (decl) = TYPE_VOLATILE (type);