dbxout.c (dbxout_type): Better "variant" handling to ignore const/volatile but not...
authorPer Bothner <bothner@gcc.gnu.org>
Wed, 13 Mar 1996 05:47:30 +0000 (21:47 -0800)
committerPer Bothner <bothner@gcc.gnu.org>
Wed, 13 Mar 1996 05:47:30 +0000 (21:47 -0800)
* dbxout.c (dbxout_type):  Better "variant" handling to ignore
const/volatile but not typedef names.  Improves Feb 12 change.

From-SVN: r11523

gcc/dbxout.c

index 17c5687729250c55f3c71d0e619f1d12aa782a0b..39c61ea0c4c3292b4e691961f1d27961c0e78200 100644 (file)
@@ -1057,10 +1057,20 @@ dbxout_type (type, full, show_arg_types)
      by assuming `int'.  */
   if (type == error_mark_node)
     type = integer_type_node;
-  else if (!(TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
-            && DECL_ORIGINAL_TYPE (TYPE_NAME (type))))
+  else
     {
-      type = TYPE_MAIN_VARIANT (type);
+      /* Try to find the "main variant" with the same name but not const
+        or volatile.  (Since stabs does not distinguish const and volatile,
+        there is no need to make them separate types.  But types with
+        different names are usefully distinguished.) */
+        
+      for (tem = TYPE_MAIN_VARIANT (type); tem; tem = TYPE_NEXT_VARIANT (tem))
+       if (!TYPE_READONLY (tem) && !TYPE_VOLATILE (tem)
+           && TYPE_NAME (tem) == TYPE_NAME (type))
+         {
+           type = tem;
+           break;
+         }
       if (TYPE_NAME (type)
          && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
          && TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (type)))