OSDN Git Service

* gcc.dg/compat/scalar-by-value-3_main.c: New file.
[pf3gnuchains/gcc-fork.git] / gcc / dwarfout.c
index 1f7817a..8555443 100644 (file)
@@ -1,6 +1,6 @@
 /* Output Dwarf format symbol table information from the GNU C compiler.
-   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 2002,
-   1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003 Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices.
 
 This file is part of GCC.
@@ -43,7 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
  The generation of DWARF debugging information by the GNU version 2.x C
  compiler has now been tested rather extensively for m88k, i386, i860, and
- Sparc targets.  The DWARF output of the GNU C compiler appears to inter-
+ SPARC targets.  The DWARF output of the GNU C compiler appears to inter-
  operate well with the standard SVR4 SDB debugger on these kinds of target
  systems (but of course, there are no guarantees).
 
@@ -162,7 +162,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  is required by the current DWARF draft specification.
 
  Specifically, the current DWARF draft specification seems to require that
- the type of an non-unsigned integral bit-field member of a struct or union
+ the type of a non-unsigned integral bit-field member of a struct or union
  type be represented as either a "signed" type or as a "plain" type,
  depending upon the exact set of keywords that were used in the
  type specification for the given bit-field member.  It was felt (by the
@@ -563,9 +563,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 */
 
 #include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 
 #ifdef DWARF_DEBUGGING_INFO
-#include "system.h"
 #include "dwarf.h"
 #include "tree.h"
 #include "flags.h"
@@ -579,6 +581,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "toplev.h"
 #include "tm_p.h"
 #include "debug.h"
+#include "target.h"
 #include "langhooks.h"
 
 /* NOTE: In the comments in this file, many references are made to
@@ -600,7 +603,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   fprintf ((FILE), "%s", reg_names[REGNO (RTX)])
 #endif
 
-/* Define a macro which returns non-zero for any tagged type which is
+/* Define a macro which returns nonzero for any tagged type which is
    used (directly or indirectly) in the specification of either some
    function's return type or some formal parameter of some function.
    We use this macro when we are operating in "terse" mode to help us
@@ -612,12 +615,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    for these nodes.  For now, we have to just fake it.  It it safe for
    us to simply return zero for all complete tagged types (which will
    get forced out anyway if they were used in the specification of some
-   formal or return type) and non-zero for all incomplete tagged types.
+   formal or return type) and nonzero for all incomplete tagged types.
 */
 
 #define TYPE_USED_FOR_FUNCTION(tagged_type) (TYPE_SIZE (tagged_type) == 0)
 
-/* Define a macro which returns non-zero for a TYPE_DECL which was
+/* Define a macro which returns nonzero for a TYPE_DECL which was
    implicitly generated for a tagged type.
 
    Note that unlike the gcc front end (which generates a NULL named
@@ -707,7 +710,7 @@ static unsigned pending_siblings_allocated;
 
 #define PENDING_SIBLINGS_INCREMENT 64
 
-/* Non-zero if we are performing our file-scope finalization pass and if
+/* Nonzero if we are performing our file-scope finalization pass and if
    we should force out Dwarf descriptions of any and all file-scope
    tagged types which are still incomplete types.  */
 
@@ -782,9 +785,9 @@ static void dwarfout_end_source_file        PARAMS ((unsigned));
 static void dwarfout_end_source_file_check PARAMS ((unsigned));
 static void dwarfout_begin_block       PARAMS ((unsigned, unsigned));
 static void dwarfout_end_block         PARAMS ((unsigned, unsigned));
-static void dwarfout_end_epilogue      PARAMS ((void));
+static void dwarfout_end_epilogue      PARAMS ((unsigned int, const char *));
 static void dwarfout_source_line       PARAMS ((unsigned int, const char *));
-static void dwarfout_end_prologue      PARAMS ((unsigned int));
+static void dwarfout_end_prologue      PARAMS ((unsigned int, const char *));
 static void dwarfout_end_function      PARAMS ((unsigned int));
 static void dwarfout_function_decl     PARAMS ((tree));
 static void dwarfout_global_decl       PARAMS ((tree));
@@ -1015,7 +1018,7 @@ static void retry_incomplete_types        PARAMS ((void));
    stock m88k/svr4 assembler, both of which need to see .L at the start of
    a label in order to prevent that label from going into the linker symbol
    table).  When I get time, I'll have to fix this the right way so that we
-   will use ASM_GENERATE_INTERNAL_LABEL and ASM_OUTPUT_INTERNAL_LABEL herein,
+   will use ASM_GENERATE_INTERNAL_LABEL and (*targetm.asm_out.internal_label) herein,
    but that will require a rather massive set of changes.  For the moment,
    the following definitions out to produce the right results for all svr4
    and svr3 assemblers. -- rfg
@@ -1291,7 +1294,8 @@ const struct gcc_debug_hooks dwarf_debug_hooks =
   dwarfout_global_decl,
   dwarfout_deferred_inline_function,
   debug_nothing_tree,          /* outlining_inline_function */
-  debug_nothing_rtx            /* label */
+  debug_nothing_rtx,           /* label */
+  debug_nothing_int            /* handle_pch */
 };
 \f
 /************************ general utility functions **************************/
@@ -1325,7 +1329,7 @@ type_main_variant (type)
   return type;
 }
 
-/* Return non-zero if the given type node represents a tagged type.  */
+/* Return nonzero if the given type node represents a tagged type.  */
 
 static inline int
 is_tagged_type (type)
@@ -1950,7 +1954,7 @@ write_modifier_bytes (type, decl_const, decl_volatile)
   write_modifier_bytes_1 (type, decl_const, decl_volatile, 0);
 }
 \f
-/* Given a pointer to an arbitrary ..._TYPE tree node, return non-zero if the
+/* Given a pointer to an arbitrary ..._TYPE tree node, return nonzero if the
    given input type is a Dwarf "fundamental" type.  Otherwise return zero.  */
 
 static inline int
@@ -2095,9 +2099,7 @@ output_mem_loc_descriptor (rtl)
      which is actually within the array.  That's *not* necessarily the
      same as the zeroth element of the array.  */
 
-#ifdef ASM_SIMPLIFY_DWARF_ADDR
-  rtl = ASM_SIMPLIFY_DWARF_ADDR (rtl);
-#endif
+  rtl = (*targetm.delegitimize_address) (rtl);
 
   switch (GET_CODE (rtl))
     {
@@ -4178,7 +4180,8 @@ static void
 output_inheritance_die (arg)
      void *arg;
 {
-  tree binfo = arg;
+  tree binfo = ((tree *)arg)[0];
+  tree access = ((tree *)arg)[1];
 
   ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_inheritance);
   sibling_attribute ();
@@ -4189,12 +4192,12 @@ output_inheritance_die (arg)
       ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual);
       ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
     }
-  if (TREE_VIA_PUBLIC (binfo))
+  if (access == access_public_node)
     {
       ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_public);
       ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
     }
-  else if (TREE_VIA_PROTECTED (binfo))
+  else if (access == access_protected_node)
     {
       ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_protected);
       ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
@@ -4533,7 +4536,7 @@ pend_type (type)
   TREE_ASM_WRITTEN (type) = 1;
 }
 
-/* Return non-zero if it is legitimate to output DIEs to represent a
+/* Return nonzero if it is legitimate to output DIEs to represent a
    given type while we are generating the list of child DIEs for some
    DIE (e.g. a function or lexical block DIE) associated with a given scope.
 
@@ -4895,18 +4898,25 @@ output_type (type, containing_scope)
 
        if (COMPLETE_TYPE_P (type))
          {
+           tree binfo = TYPE_BINFO (type);
+           
            /* First output info about the base classes.  */
-           if (TYPE_BINFO (type) && TYPE_BINFO_BASETYPES (type))
+           if (binfo)
              {
-               register tree bases = TYPE_BINFO_BASETYPES (type);
-               register int n_bases = TREE_VEC_LENGTH (bases);
+               tree bases = BINFO_BASETYPES (binfo);
+               tree accesses = BINFO_BASEACCESSES (binfo);
+               register int n_bases = BINFO_N_BASETYPES (binfo);
                register int i;
 
                for (i = 0; i < n_bases; i++)
                  {
-                   tree binfo = TREE_VEC_ELT (bases, i);
+                   tree arg[2];
+
+                   arg[0] = TREE_VEC_ELT (bases, i);
+                   arg[1] = (accesses ? TREE_VEC_ELT (accesses, i)
+                             : access_public_node);
                    output_type (BINFO_TYPE (binfo), containing_scope);
-                   output_die (output_inheritance_die, binfo);
+                   output_die (output_inheritance_die, arg);
                  }
              }
 
@@ -5835,8 +5845,9 @@ dwarfout_end_block (line, blocknum)
    to their home locations).  */
 
 static void
-dwarfout_end_prologue (line)
+dwarfout_end_prologue (line, file)
      unsigned int line ATTRIBUTE_UNUSED;
+     const char *file ATTRIBUTE_UNUSED;
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
@@ -5869,7 +5880,9 @@ dwarfout_end_function (line)
    has been generated. */
 
 static void
-dwarfout_end_epilogue ()
+dwarfout_end_epilogue (line, file)
+     unsigned int line ATTRIBUTE_UNUSED;
+     const char *file ATTRIBUTE_UNUSED;
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
@@ -6272,7 +6285,7 @@ dwarfout_init (main_input_filename)
            char *dirname;
 
            if (!pwd)
-             fatal_io_error ("can't get current directory");
+             fatal_error ("can't get current directory: %m");
 
            dirname = concat (pwd, "/", NULL);
            ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname);