summaryrefslogtreecommitdiff
path: root/gdb/c-typeprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-01-14 20:59:26 +0000
committerTom Tromey <tromey@redhat.com>2013-01-14 20:59:26 +0000
commitda47a9b7b95481e82517c49bdb5c83c72826fb98 (patch)
tree2da03a0fbef3db55c78469fbd63fba9d3d234c4f /gdb/c-typeprint.c
parent0a07598a6944a2848e1b7d33d0baad774fb9156a (diff)
downloadgdb-da47a9b7b95481e82517c49bdb5c83c72826fb98.tar.gz
PR symtab/14442:
* c-typeprint.c (cp_type_print_method_args): Handle 'restrict'. (c_type_print_modifier): Likewise. * dwarf2read.c (read_tag_restrict_type): New function. (read_type_die_1): Handle DW_TAG_restrict_type. * gdbtypes.c (make_restrict_type): New function. (recursive_dump_type): Handle TYPE_RESTRICT. * gdbtypes.h (enum type_flag_values): Renumber. (enum type_instance_flag_value): Add TYPE_INSTANCE_FLAG_RESTRICT. (TYPE_RESTRICT): New macro. (make_restrict_type): Declare. gdb/testsuite * gdb.dwarf2/dw2-restrict.S: New file. * gdb.dwarf2/dw2-restrict.c: New file. * gdb.dwarf2/dw2-restrict.exp: New file.
Diffstat (limited to 'gdb/c-typeprint.c')
-rw-r--r--gdb/c-typeprint.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index cb75a4e2764..a6db16290ef 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -269,6 +269,9 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
if (TYPE_VOLATILE (domain))
fprintf_filtered (stream, " volatile");
+
+ if (TYPE_RESTRICT (domain))
+ fprintf_filtered (stream, " restrict");
}
}
@@ -422,6 +425,14 @@ c_type_print_modifier (struct type *type, struct ui_file *stream,
did_print_modifier = 1;
}
+ if (TYPE_RESTRICT (type))
+ {
+ if (did_print_modifier || need_pre_space)
+ fprintf_filtered (stream, " ");
+ fprintf_filtered (stream, "restrict");
+ did_print_modifier = 1;
+ }
+
address_space_id = address_space_int_to_name (get_type_arch (type),
TYPE_INSTANCE_FLAGS (type));
if (address_space_id)