decl.c (gnat_to_gnu_entity): Build a stub DECL for the dummy fat pointer type in...
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 13 Dec 2010 18:10:49 +0000 (18:10 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 13 Dec 2010 18:10:49 +0000 (18:10 +0000)
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_General_Access_Type>:
Build a stub DECL for the dummy fat pointer type in the unconstrained
array case.
* gcc-interface/utils.c (update_pointer_to): Set the DECL_ORIGINAL_TYPE
for all the variants in the fat pointer case.

From-SVN: r167758

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/utils.c

index a42758d..4972d30 100644 (file)
@@ -1,5 +1,13 @@
 2010-12-13  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <E_General_Access_Type>:
+       Build a stub DECL for the dummy fat pointer type in the unconstrained
+       array case.
+       * gcc-interface/utils.c (update_pointer_to): Set the DECL_ORIGINAL_TYPE
+       for all the variants in the fat pointer case.
+
+2010-12-13  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/trans.c (can_be_lower_p): New predicate.
        (Loop_Statement_to_gnu): Do not generate the entry condition if we know
        that it will be true.
index 8980bb2..b45033f 100644 (file)
@@ -3566,6 +3566,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                TYPE_DUMMY_P (gnu_array_type) = 1;
 
                gnu_type = make_node (RECORD_TYPE);
+               /* Build a stub DECL to trigger the special processing for fat
+                  pointer types in gnat_pushdecl.  */
+               TYPE_NAME (gnu_type)
+                 = create_type_stub_decl
+                   (create_concat_name (gnat_desig_equiv, "XUP"), gnu_type);
                SET_TYPE_UNCONSTRAINED_ARRAY (gnu_type, gnu_desig_type);
                TYPE_POINTER_TO (gnu_desig_type) = gnu_type;
 
index fa2d096..d044957 100644 (file)
@@ -3501,15 +3501,16 @@ update_pointer_to (tree old_type, tree new_type)
        {
          TYPE_MAIN_VARIANT (t) = new_ptr;
          SET_TYPE_UNCONSTRAINED_ARRAY (t, new_type);
-       }
 
-      /* And show the original pointer NEW_PTR to the debugger.  This is the
-        counterpart of the equivalent processing in gnat_pushdecl when the
-        unconstrained array type is frozen after access types to it.  */
-      if (TYPE_NAME (ptr) && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL)
-       {
-         DECL_ORIGINAL_TYPE (TYPE_NAME (ptr)) = new_ptr;
-         DECL_ARTIFICIAL (TYPE_NAME (ptr)) = 0;
+         /* And show the original pointer NEW_PTR to the debugger.  This is
+            the counterpart of the special processing for fat pointer types
+            in gnat_pushdecl, but when the unconstrained array type is only
+            frozen after access types to it.  */
+         if (TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL)
+           {
+             DECL_ORIGINAL_TYPE (TYPE_NAME (t)) = new_ptr;
+             DECL_ARTIFICIAL (TYPE_NAME (t)) = 0;
+           }
        }
 
       /* Now handle updating the allocation record, what the thin pointer