OSDN Git Service

2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / rtl-error.c
index 16d5350..6f38631 100644 (file)
@@ -1,12 +1,12 @@
 /* RTL specific diagnostic subroutines for GCC
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
    Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GCC is distributed in the hope that it will be useful,
@@ -15,9 +15,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
 #undef FLOAT /* This is for hpux. They should change hpux.  */
@@ -33,12 +32,12 @@ Boston, MA 02111-1307, USA.  */
 #include "intl.h"
 #include "diagnostic.h"
 
-static location_t location_for_asm (rtx);
-static void diagnostic_for_asm (rtx, const char *, va_list *, diagnostic_t);
+static location_t location_for_asm (const_rtx);
+static void diagnostic_for_asm (const_rtx, const char *, va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);
 
 /* Figure the location of the given INSN.  */
 static location_t
-location_for_asm (rtx insn)
+location_for_asm (const_rtx insn)
 {
   rtx body = PATTERN (insn);
   rtx asmop;
@@ -59,14 +58,7 @@ location_for_asm (rtx insn)
     asmop = NULL;
 
   if (asmop)
-#ifdef USE_MAPPED_LOCATION
     loc = ASM_OPERANDS_SOURCE_LOCATION (asmop);
-#else
-    {
-      loc.file = ASM_OPERANDS_SOURCE_FILE (asmop);
-      loc.line = ASM_OPERANDS_SOURCE_LINE (asmop);
-    }
-#endif
   else
     loc = input_location;
   return loc;
@@ -76,7 +68,7 @@ location_for_asm (rtx insn)
    of the insn INSN.  This is used only when INSN is an `asm' with operands,
    and each ASM_OPERANDS records its own source file and line.  */
 static void
-diagnostic_for_asm (rtx insn, const char *msg, va_list *args_ptr,
+diagnostic_for_asm (const_rtx insn, const char *msg, va_list *args_ptr,
                    diagnostic_t kind)
 {
   diagnostic_info diagnostic;
@@ -87,27 +79,27 @@ diagnostic_for_asm (rtx insn, const char *msg, va_list *args_ptr,
 }
 
 void
-error_for_asm (rtx insn, const char *msgid, ...)
+error_for_asm (const_rtx insn, const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_for_asm (insn, msgid, &ap, DK_ERROR);
+  va_start (ap, gmsgid);
+  diagnostic_for_asm (insn, gmsgid, &ap, DK_ERROR);
   va_end (ap);
 }
 
 void
-warning_for_asm (rtx insn, const char *msgid, ...)
+warning_for_asm (const_rtx insn, const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_for_asm (insn, msgid, &ap, DK_WARNING);
+  va_start (ap, gmsgid);
+  diagnostic_for_asm (insn, gmsgid, &ap, DK_WARNING);
   va_end (ap);
 }
 
 void
-_fatal_insn (const char *msgid, rtx insn, const char *file, int line,
+_fatal_insn (const char *msgid, const_rtx insn, const char *file, int line,
             const char *function)
 {
   error ("%s", _(msgid));
@@ -121,7 +113,7 @@ _fatal_insn (const char *msgid, rtx insn, const char *file, int line,
 }
 
 void
-_fatal_insn_not_found (rtx insn, const char *file, int line,
+_fatal_insn_not_found (const_rtx insn, const char *file, int line,
                       const char *function)
 {
   if (INSN_CODE (insn) < 0)