aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-10-10 11:47:29 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-10-10 11:47:29 +0000
commit4304395d8602b0913bcfb1e65984e3aefa5bcf69 (patch)
tree3e8777f65084ba98d2b4d5c19d7450e674b470f2
parent0c70025900f1242f8aa7822e1f681bb76ec12893 (diff)
downloadgcc-4304395d8602b0913bcfb1e65984e3aefa5bcf69.zip
gcc-4304395d8602b0913bcfb1e65984e3aefa5bcf69.tar.gz
gcc-4304395d8602b0913bcfb1e65984e3aefa5bcf69.tar.bz2
decl.c (gnat_to_gnu_entity): Add assertion on the types of the parameters.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Add assertion on the types of the parameters. Use KIND local variable. <E_Incomplete_Type>: Likewise. From-SVN: r165251
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/decl.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 31316e2..7f6d18e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2010-10-10 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Add
+ assertion on the types of the parameters. Use KIND local variable.
+ <E_Incomplete_Type>: Likewise.
+
+2010-10-10 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/ada-tree.h (DECL_BY_DOUBLE_REF_P): New macro.
* gcc-interface/gigi.h (annotate_object): Add BY_DOUBLE_REF parameter.
* gcc-interface/decl.c (annotate_object): Likewise and handle it.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 98ca932..1719d1c 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -4149,6 +4149,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_param = NULL_TREE;
}
+ /* The failure of this assertion will very likely come from an
+ order of elaboration issue for the type of the parameter. */
+ gcc_assert (kind == E_Subprogram_Type
+ || !TYPE_IS_DUMMY_P (gnu_param_type));
+
if (gnu_param)
{
/* If it's an exported subprogram, we build a parameter list
@@ -4246,7 +4251,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_stub_param_list = nreverse (gnu_stub_param_list);
gnu_cico_list = nreverse (gnu_cico_list);
- if (Ekind (gnat_entity) == E_Function)
+ if (kind == E_Function)
Set_Mechanism (gnat_entity, return_unconstrained_p
|| return_by_direct_ref_p
|| return_by_invisi_ref_p
@@ -4396,8 +4401,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
full view, whichever is present. This is used in all the tests
below. */
Entity_Id full_view
- = (IN (Ekind (gnat_entity), Incomplete_Kind)
- && From_With_Type (gnat_entity))
+ = (IN (kind, Incomplete_Kind) && From_With_Type (gnat_entity))
? Non_Limited_View (gnat_entity)
: Present (Full_View (gnat_entity))
? Full_View (gnat_entity)