OSDN Git Service

* rtl.h (addr_diff_vec_flags): New typedef.
[pf3gnuchains/gcc-fork.git] / gcc / xcoffout.c
index e5b900e..60f6b32 100644 (file)
@@ -1,5 +1,5 @@
 /* Output xcoff-format symbol table information from GNU compiler.
-   Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 
 /* Output xcoff-format symbol table data.  The main functionality is contained
@@ -52,7 +53,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Line number of beginning of current function, minus one.
    Negative means not in a function or not using xcoff.  */
 
-int xcoff_begin_function_line = -1;
+static int xcoff_begin_function_line = -1;
+static int xcoff_inlining = 0;
 
 /* Name of the current include file.  */
 
@@ -63,7 +65,7 @@ char *xcoff_current_include_file;
    (by including that file of course), then the line number will be
    absolute.  */
 
-char *xcoff_current_function_file;
+static char *xcoff_current_function_file;
 
 /* Names of bss and data sections.  These should be unique names for each
    compilation unit.  */
@@ -79,7 +81,7 @@ char *xcoff_lastfile;
 /* Macro definitions used below.  */
 
 #define ABS_OR_RELATIVE_LINENO(LINENO)         \
- (xcoff_current_include_file ? (LINENO) : (LINENO) - xcoff_begin_function_line)
+((xcoff_inlining) ? (LINENO) : (LINENO) - xcoff_begin_function_line)
 
 /* Output source line numbers via ".line" rather than ".stabd".  */
 #define ASM_OUTPUT_SOURCE_LINE(FILE,LINENUM) \
@@ -143,14 +145,14 @@ xcoff_output_standard_types (syms)
 {
   /* Handle built-in C types here.  */
 
-  assign_type_number (syms, "int", (TARGET_64BIT ? -31 : -1));
+  assign_type_number (syms, "int", -1);
   assign_type_number (syms, "char", -2);
   assign_type_number (syms, "short int", -3);
   assign_type_number (syms, "long int", (TARGET_64BIT ? -31 : -4));
   assign_type_number (syms, "unsigned char", -5);
   assign_type_number (syms, "signed char", -6);
   assign_type_number (syms, "short unsigned int", -7);
-  assign_type_number (syms, "unsigned int", (TARGET_64BIT ? -32 : -8));
+  assign_type_number (syms, "unsigned int", -8);
   /* No such type "unsigned".  */
   assign_type_number (syms, "long unsigned int", (TARGET_64BIT ? -32 : -10));
   assign_type_number (syms, "void", -11);
@@ -315,19 +317,6 @@ stab_to_sclass (stab)
   }
 }
 \f
-/* In XCOFF, we have to have this .bf before the function prologue.
-   Rely on the value of `dbx_begin_function_line' not to duplicate .bf.  */
-
-void
-xcoffout_output_first_source_line (file, last_linenum)
-     FILE *file;
-     int last_linenum;
-{
-  ASM_OUTPUT_LFB (file, last_linenum);
-  dbxout_parms (DECL_ARGUMENTS (current_function_decl));
-  ASM_OUTPUT_SOURCE_LINE (file, last_linenum);
-}
-
 /* Output debugging info to FILE to switch to sourcefile FILENAME.
    INLINE_P is true if this is from an inlined function.  */
 
@@ -339,8 +328,8 @@ xcoffout_source_file (file, filename, inline_p)
 {
   if (filename
       && (xcoff_lastfile == 0 || strcmp (filename, xcoff_lastfile)
-         || (inline_p && ! xcoff_current_include_file)
-         || (! inline_p && xcoff_current_include_file)))
+         || (inline_p && ! xcoff_inlining)
+         || (! inline_p && xcoff_inlining)))
     {
       if (xcoff_current_include_file)
        {
@@ -349,6 +338,7 @@ xcoffout_source_file (file, filename, inline_p)
          fprintf (file, "\n");
          xcoff_current_include_file = NULL;
        }
+       xcoff_inlining=inline_p;
       if (strcmp (main_input_filename, filename) || inline_p)
        {
          fprintf (file, "\t.bi\t");
@@ -472,16 +462,19 @@ xcoffout_declare_function (file, decl, name)
   char *n = name;
   int i;
 
-  for (i = 0; name[i]; ++i)
-    {
-      if (name[i] == '[')
-       {
-         n = (char *) alloca (i + 1);
-         strncpy (n, name, i);
-         n[i] = '\0';
-         break;
-       }
-    }
+  if (*n == '*')
+    n++;
+  else
+    for (i = 0; name[i]; ++i)
+      {
+       if (name[i] == '[')
+         {
+           n = (char *) alloca (i + 1);
+           strncpy (n, name, i);
+           n[i] = '\0';
+           break;
+         }
+      }
 
   /* Any pending .bi or .ei must occur before the .function pseudo op.
      Otherwise debuggers will think that the function is in the previous
@@ -502,6 +495,8 @@ xcoffout_begin_function (file, last_linenum)
      int last_linenum;
 {
   ASM_OUTPUT_LFB (file, last_linenum);
+  dbxout_parms (DECL_ARGUMENTS (current_function_decl));
+  ASM_OUTPUT_SOURCE_LINE (file, last_linenum);
 }
 
 /* Called at end of function (before epilogue).