gigi.h (make_aligning_type): Adjust prototype.
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 26 May 2013 08:55:43 +0000 (08:55 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 26 May 2013 08:55:43 +0000 (08:55 +0000)
* gcc-interface/gigi.h (make_aligning_type): Adjust prototype.
* gcc-interface/utils.c (make_aligning_type): Take GNAT_NODE parameter
for the position of the associated TYPE_DECL.
* gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to above.
* gcc-interface/utils2.c (maybe_wrap_malloc): Likewise.

From-SVN: r199337

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/utils.c
gcc/ada/gcc-interface/utils2.c

index 2844de415ed00061c6a6a33a539776582e7b693b..2b31a004dbd59e982dc5ea311ea8f7b898e1d0b7 100644 (file)
@@ -1,3 +1,11 @@
+2013-05-26  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/gigi.h (make_aligning_type): Adjust prototype.
+       * gcc-interface/utils.c (make_aligning_type): Take GNAT_NODE parameter
+       for the position of the associated TYPE_DECL.
+       * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to above.
+       * gcc-interface/utils2.c (maybe_wrap_malloc): Likewise.
+
 2013-05-26  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/decl.c (gnat_to_gnu_entity): Do not prematurely
index 4a528b20d1d5423092ba035e0c3671ba446476bf..2a6eb4dcb4430fcfe8473183ef90350357d5d36d 100644 (file)
@@ -1368,7 +1368,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
            tree gnu_new_type
              = make_aligning_type (gnu_type, TYPE_ALIGN (gnu_type),
                                    TYPE_SIZE_UNIT (gnu_type),
-                                   BIGGEST_ALIGNMENT, 0);
+                                   BIGGEST_ALIGNMENT, 0, gnat_entity);
            tree gnu_new_var
              = create_var_decl (create_concat_name (gnat_entity, "ALIGN"),
                                 NULL_TREE, gnu_new_type, NULL_TREE, false,
index e2cc1466cab9e03e6717ab65a07e1f342c4b51a5..a95b867eb8d46148ffac29dfd82510fc201c079b 100644 (file)
@@ -123,9 +123,10 @@ extern bool is_cplusplus_method (Entity_Id gnat_entity);
 /* Create a record type that contains a SIZE bytes long field of TYPE with a
     starting bit position so that it is aligned to ALIGN bits, and leaving at
     least ROOM bytes free before the field.  BASE_ALIGN is the alignment the
-    record is guaranteed to get.  */
+    record is guaranteed to get.  GNAT_NODE is used for the position of the
+    associated TYPE_DECL.  */
 extern tree make_aligning_type (tree type, unsigned int align, tree size,
-                               unsigned int base_align, int room);
+                               unsigned int base_align, int room, Node_Id);
 
 /* TYPE is a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE that is being used
    as the field type of a packed record if IN_RECORD is true, or as the
index 0906c0c319de27cb32d9e446e162d729b007f241..eb63257ec369df5ad360c1c08bb08d1b0ce5f6d4 100644 (file)
@@ -653,11 +653,12 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
 /* Create a record type that contains a SIZE bytes long field of TYPE with a
    starting bit position so that it is aligned to ALIGN bits, and leaving at
    least ROOM bytes free before the field.  BASE_ALIGN is the alignment the
-   record is guaranteed to get.  */
+   record is guaranteed to get.  GNAT_NODE is used for the position of the
+   associated TYPE_DECL.  */
 
 tree
 make_aligning_type (tree type, unsigned int align, tree size,
-                   unsigned int base_align, int room)
+                   unsigned int base_align, int room, Node_Id gnat_node)
 {
   /* We will be crafting a record type with one field at a position set to be
      the next multiple of ALIGN past record'address + room bytes.  We use a
@@ -739,7 +740,7 @@ make_aligning_type (tree type, unsigned int align, tree size,
 
   /* Declare it now since it will never be declared otherwise.  This is
      necessary to ensure that its subtrees are properly marked.  */
-  create_type_decl (name, record_type, NULL, true, false, Empty);
+  create_type_decl (name, record_type, NULL, true, false, gnat_node);
 
   return record_type;
 }
index 71dd8e5651395b0d56da8069243f7e96e90c54ac..3f39a43269606051a1f55a2f616a886cfe01bc00 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2012, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2013, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -2101,7 +2101,8 @@ maybe_wrap_malloc (tree data_size, tree data_type, Node_Id gnat_node)
     = ((data_align > system_allocator_alignment)
        ? make_aligning_type (data_type, data_align, data_size,
                             system_allocator_alignment,
-                            POINTER_SIZE / BITS_PER_UNIT)
+                            POINTER_SIZE / BITS_PER_UNIT,
+                            gnat_node)
        : NULL_TREE);
 
   tree size_to_malloc