aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorNicolas Setton <setton@adacore.com>2008-06-06 21:36:28 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2008-06-06 21:36:28 +0000
commit081a52ed5221b9fe0280f80b3646c6118eb3ed1c (patch)
tree92a62fd35271bf3f29e34745397c5bfee0abfb25 /gcc/ada/utils.c
parente919209b4eb54e6f731510475c4b8ed64c23140e (diff)
downloadgcc-081a52ed5221b9fe0280f80b3646c6118eb3ed1c.zip
gcc-081a52ed5221b9fe0280f80b3646c6118eb3ed1c.tar.gz
gcc-081a52ed5221b9fe0280f80b3646c6118eb3ed1c.tar.bz2
ada-tree.h (DECL_PARALLEL_TYPE): New language specific attribute...
2008-06-06 Nicolas Setton <setton@adacore.com> Olivier Hainque <hainque@adacore.com> * ada-tree.h (DECL_PARALLEL_TYPE): New language specific attribute, parallel descriptive type attached to another type for debug info generation purposes. * utils.c (add_parallel_type): New function, register parallel type to be attached to a type. (get_parallel_type): New function, fetch a registered parallel type, if any. (rest_of_record_type_compilation): Register the parallel type we make for variable size records. * gigi.h (add_parallel_type, get_parallel_type): Declare. * decl.c (gnat_to_gnu_entity, maybe_pad_type): Register the parallel debug types we make. * trans.c (extract_encoding, decode_name): New functions. (gigi): If the DWARF attribute extensions are available, setup to use them. * lang.opt: Register language specific processing request for -gdwarf+. * misc.c (gnat_dwarf_extensions): New global variable. How much do we want of our DWARF extensions. 0 by default. (gnat_handle_option) <OPT_gdwarf_>: Increment gnat_dwarf_extensions. (gnat_post_options): Map gnat_dwarf_extensions to the common use_gnu_debug_info_extensions for later processing. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r136506
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 4d10940..ef49d10 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -1059,6 +1059,8 @@ rest_of_record_type_compilation (tree record_type)
TYPE_SIZE_UNIT (new_record_type)
= size_int (TYPE_ALIGN (record_type) / BITS_PER_UNIT);
+ add_parallel_type (TYPE_STUB_DECL (record_type), new_record_type);
+
/* Now scan all the fields, replacing each field with a new
field corresponding to the new encoding. */
for (old_field = TYPE_FIELDS (record_type); old_field;
@@ -1201,6 +1203,30 @@ rest_of_record_type_compilation (tree record_type)
rest_of_type_decl_compilation (TYPE_STUB_DECL (record_type));
}
+/* Append PARALLEL_TYPE on the chain of parallel types for decl. */
+
+void
+add_parallel_type (tree decl, tree parallel_type)
+{
+ tree d = decl;
+
+ while (DECL_PARALLEL_TYPE (d))
+ d = TYPE_STUB_DECL (DECL_PARALLEL_TYPE (d));
+
+ SET_DECL_PARALLEL_TYPE (d, parallel_type);
+}
+
+/* Return the parallel type associated to a type, if any. */
+
+tree
+get_parallel_type (tree type)
+{
+ if (TYPE_STUB_DECL (type))
+ return DECL_PARALLEL_TYPE (TYPE_STUB_DECL (type));
+ else
+ return NULL_TREE;
+}
+
/* Utility function of above to merge LAST_SIZE, the previous size of a record
with FIRST_BIT and SIZE that describe a field. SPECIAL is nonzero
if this represents a QUAL_UNION_TYPE in which case we must look for