OSDN Git Service

update copyrights
[pf3gnuchains/gcc-fork.git] / gcc / dbxout.c
index 7da5ad8..c3838df 100644 (file)
@@ -454,8 +454,6 @@ dbxout_init (asm_file, input_file_name, syms)
      and output them all, except for those already output.  */
 
   dbxout_typedefs (syms);
-
-  ggc_add_string_root ((char **) &lastfile, 1);
 }
 
 /* Output any typedef names for types described by TYPE_DECLs in SYMS,
@@ -1043,7 +1041,7 @@ dbxout_type (type, full, show_arg_types)
          typevec
            = (struct typeinfo *) xrealloc (typevec,
                                            typevec_len * 2 * sizeof typevec[0]);
-         bzero ((char *) (typevec + typevec_len),
+         memset ((char *) (typevec + typevec_len), 0,
                 typevec_len * sizeof typevec[0]);
          typevec_len *= 2;
        }
@@ -2472,6 +2470,24 @@ dbxout_parms (parms)
            dbxout_finish_symbol (parms);
          }
        else if (GET_CODE (DECL_RTL (parms)) == MEM
+                && GET_CODE (XEXP (DECL_RTL (parms), 0)) == MEM)
+         {
+           /* Parm was passed via invisible reference, with the reference
+              living on the stack.  DECL_RTL looks like
+              (MEM (MEM (PLUS (REG ...) (CONST_INT ...)))).  */
+           const char *decl_name = (DECL_NAME (parms)
+                                    ? IDENTIFIER_POINTER (DECL_NAME (parms))
+                                    : "(anon)");
+           current_sym_value
+             = INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms), 0), 0), 1));
+           current_sym_addr = 0;
+             
+           FORCE_TEXT;
+           fprintf (asmfile, "%s\"%s:v", ASM_STABS_OP, decl_name);
+           dbxout_type (TREE_TYPE (parms), 0, 0);
+           dbxout_finish_symbol (parms);
+         }
+       else if (GET_CODE (DECL_RTL (parms)) == MEM
                 && XEXP (DECL_RTL (parms), 0) != const0_rtx
                 /* ??? A constant address for a parm can happen
                    when the reg it lives in is equiv to a constant in memory.
@@ -2479,22 +2495,14 @@ dbxout_parms (parms)
                 && ! CONSTANT_P (XEXP (DECL_RTL (parms), 0)))
          {
            /* Parm was passed in registers but lives on the stack.  */
-           int aux_sym_value = 0;
 
            current_sym_code = N_PSYM;
            /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...))),
               in which case we want the value of that CONST_INT,
-              or (MEM (REG ...)) or (MEM (MEM ...)),
+              or (MEM (REG ...)),
               in which case we use a value of zero.  */
            if (GET_CODE (XEXP (DECL_RTL (parms), 0)) == REG)
              current_sym_value = 0;
-           else if (GET_CODE (XEXP (DECL_RTL (parms), 0)) == MEM)
-             {
-               /* Remember the location on the stack the parm is moved to */
-               aux_sym_value
-                 = INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms), 0), 0), 1));
-               current_sym_value = 0;
-             }
            else
                current_sym_value
                  = INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1));
@@ -2534,17 +2542,6 @@ dbxout_parms (parms)
                                     XEXP (DECL_RTL (parms), 0));
            dbxout_type (TREE_TYPE (parms), 0, 0);
            dbxout_finish_symbol (parms);
-           if (aux_sym_value != 0)
-             {
-               /* Generate an entry for the stack location */
-
-               fprintf (asmfile, "%s\"%s:", ASM_STABS_OP,
-                        IDENTIFIER_POINTER (DECL_NAME (parms)));
-               current_sym_value = aux_sym_value;
-               current_sym_code = N_LSYM;
-               dbxout_type (build_reference_type (TREE_TYPE (parms)), 0, 0);
-               dbxout_finish_symbol (parms);
-             }
          }
       }
 }
@@ -2644,7 +2641,6 @@ dbxout_block (block, depth, args)
      tree args;
 {
   int blocknum = -1;
-  int ignored;
 
 #if DBX_BLOCKS_FUNCTION_RELATIVE
   const char *begin_label; 
@@ -2659,12 +2655,16 @@ dbxout_block (block, depth, args)
       /* Ignore blocks never expanded or otherwise marked as real.  */
       if (TREE_USED (block) && TREE_ASM_WRITTEN (block))
        {
-#ifndef DBX_LBRAC_FIRST
+         int did_output;
+
+#ifdef DBX_LBRAC_FIRST
+         did_output = 1;
+#else
          /* In dbx format, the syms of a block come before the N_LBRAC.
             If nothing is output, we don't need the N_LBRAC, either. */
-         ignored = 1;
+         did_output = 0;
          if (debug_info_level != DINFO_LEVEL_TERSE || depth == 0)
-           ignored = dbxout_syms (BLOCK_VARS (block));
+           did_output = dbxout_syms (BLOCK_VARS (block));
          if (args)
            dbxout_reg_parms (args);
 #endif
@@ -2673,7 +2673,7 @@ dbxout_block (block, depth, args)
             the block.  Use the block's tree-walk order to generate
             the assembler symbols LBBn and LBEn
             that final will define around the code in this block.  */
-         if (depth > 0 && !ignored)
+         if (depth > 0 && did_output)
            {
              char buf[20];
              blocknum = BLOCK_NUMBER (block);
@@ -2723,7 +2723,7 @@ dbxout_block (block, depth, args)
          dbxout_block (BLOCK_SUBBLOCKS (block), depth + 1, NULL_TREE);
 
          /* Refer to the marker for the end of the block.  */
-         if (depth > 0 && !ignored)
+         if (depth > 0 && did_output)
            {
              char buf[20];
              ASM_GENERATE_INTERNAL_LABEL (buf, "LBE", blocknum);