change delegation for to_read_description
[deliverable/binutils-gdb.git] / gdb / c-typeprint.c
index cb75a4e276480281bc452d8f9ea2a0f2404e2b99..4edc9ec3587913b16c3459245a8ecb81b15a796f 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing C and C++ types for GDB, the GNU debugger.
-   Copyright (C) 1986-2013 Free Software Foundation, Inc.
+   Copyright (C) 1986-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -31,7 +31,7 @@
 #include "typeprint.h"
 #include "cp-abi.h"
 #include "jv-lang.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 #include "cp-support.h"
 
@@ -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)
@@ -451,13 +462,10 @@ c_type_print_args (struct type *type, struct ui_file *stream,
                   int linkage_name, enum language language,
                   const struct type_print_options *flags)
 {
-  int i, len;
-  struct field *args;
+  int i;
   int printed_any = 0;
 
   fprintf_filtered (stream, "(");
-  args = TYPE_FIELDS (type);
-  len = TYPE_NFIELDS (type);
 
   for (i = 0; i < TYPE_NFIELDS (type); i++)
     {
@@ -1219,8 +1227,8 @@ c_type_print_base (struct type *type, struct ui_file *stream,
                    mangled_name = TYPE_FN_FIELD_PHYSNAME (f, j);
 
                  demangled_name =
-                   cplus_demangle (mangled_name,
-                                   DMGL_ANSI | DMGL_PARAMS);
+                   gdb_demangle (mangled_name,
+                                 DMGL_ANSI | DMGL_PARAMS);
                  if (demangled_name == NULL)
                    {
                      /* In some cases (for instance with the HP
@@ -1287,7 +1295,6 @@ c_type_print_base (struct type *type, struct ui_file *stream,
                for (i = 0; i < TYPE_TYPEDEF_FIELD_COUNT (type); i++)
                  {
                    struct type *target = TYPE_TYPEDEF_FIELD_TYPE (type, i);
-                   struct typedef_hash_table *table2;
 
                    /* Dereference the typedef declaration itself.  */
                    gdb_assert (TYPE_CODE (target) == TYPE_CODE_TYPEDEF);
This page took 0.024507 seconds and 4 git commands to generate.