aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-09-09 12:36:20 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-09-09 12:36:20 +0000
commitf4657d60cf7027c595f2df132b6d6c20435077a4 (patch)
tree5f864b2e876ca2cdbbc1f52dcaffa842204f0b8b /gcc/ada
parent89ec98ed7ecf0a52175726cca867d471fcad9811 (diff)
downloadgcc-f4657d60cf7027c595f2df132b6d6c20435077a4.zip
gcc-f4657d60cf7027c595f2df132b6d6c20435077a4.tar.gz
gcc-f4657d60cf7027c595f2df132b6d6c20435077a4.tar.bz2
utils2.c (build_allocator): In type_annotate_only mode return NULL_EXPR.
* gcc-interface/utils2.c (build_allocator): In type_annotate_only mode return NULL_EXPR. From-SVN: r251933
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/utils2.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d0d230c..efef4f7 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/utils2.c (build_allocator): In type_annotate_only mode
+ return NULL_EXPR.
+
+2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/decl.c (promote_object_alignment): New function taken
from...
(gnat_to_gnu_entity) <E_Variable>: ...here. Invoke it.
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 543b539..072e105 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -2350,6 +2350,12 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
if (init && TREE_CODE (init) == NULL_EXPR)
return build1 (NULL_EXPR, result_type, TREE_OPERAND (init, 0));
+ /* If we are just annotating types, also return a NULL_EXPR. */
+ else if (type_annotate_only)
+ return build1 (NULL_EXPR, result_type,
+ build_call_raise (CE_Range_Check_Failed, gnat_node,
+ N_Raise_Constraint_Error));
+
/* If the initializer, if present, is a COND_EXPR, deal with each branch. */
else if (init && TREE_CODE (init) == COND_EXPR)
return build3 (COND_EXPR, result_type, TREE_OPERAND (init, 0),