*** empty log message ***
authorRichard Stallman <rms@gnu.org>
Wed, 10 Jun 1992 20:05:23 +0000 (20:05 +0000)
committerRichard Stallman <rms@gnu.org>
Wed, 10 Jun 1992 20:05:23 +0000 (20:05 +0000)
From-SVN: r1186

gcc/dbxout.c

index f680465404be220eab170fbaa5f08334345bb87c..09f6ece6bc9fc2a72a33da933dc61700fe982f23 100644 (file)
@@ -1371,6 +1371,33 @@ dbxout_symbol (decl, local)
            /* Nonzero means we must output a tag as well as a typedef.  */
            tag_needed = 0;
 
+           /* Handle the case of a C++ structure or union
+              where the TYPE_NAME is a TYPE_DECL
+              which gives both a typedef name and a tag.  */
+           /* dbx requires the tag first and the typedef second.
+              ??? there is a bug here.  It generates spurious tags
+              for C code.  */
+           if ((TREE_CODE (type) == RECORD_TYPE
+                || TREE_CODE (type) == UNION_TYPE)
+               && TYPE_NAME (type) == decl
+               && !(use_gdb_dbx_extensions && have_used_extensions)
+               && !TREE_ASM_WRITTEN (TYPE_NAME (type)))
+             {
+               tree name = TYPE_NAME (type);
+               if (TREE_CODE (name) == TYPE_DECL)
+                 name = DECL_NAME (name);
+
+               current_sym_code = DBX_TYPE_DECL_STABS_CODE;
+               current_sym_value = 0;
+               current_sym_addr = 0;
+               current_sym_nchars = 2 + IDENTIFIER_LENGTH (name);
+
+               fprintf (asmfile, "%s \"%s:T", ASM_STABS_OP,
+                        IDENTIFIER_POINTER (name));
+               dbxout_type (type, 1, 0);
+               dbxout_finish_symbol (0);
+             }
+
            /* Output typedef name.  */
            fprintf (asmfile, "%s \"%s:", ASM_STABS_OP,
                     IDENTIFIER_POINTER (DECL_NAME (decl)));
@@ -1395,8 +1422,10 @@ dbxout_symbol (decl, local)
                    putc ('T', asmfile);
                    TREE_ASM_WRITTEN (TYPE_NAME (type)) = 1;
                  }
+#if 0 /* Now we generate the tag for this case up above.  */
                else
                  tag_needed = 1;
+#endif
              }
 /* #endif */