X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Frtl-error.c;h=bbf150a71f687238065520c17b47e31a1e043ca4;hp=7526125f9a57425af49c65b597e3688980c79559;hb=f105335dc974c083a15d588f7ae903f47f7a02c2;hpb=fa70df70597245daf03e65e2b49bf9d0bdb6d3c0 diff --git a/gcc/rtl-error.c b/gcc/rtl-error.c index 7526125f9a5..bbf150a71f6 100644 --- a/gcc/rtl-error.c +++ b/gcc/rtl-error.c @@ -1,12 +1,13 @@ -/* RTL specific diagnostic subroutines for the GNU C compiler - Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +/* RTL specific diagnostic subroutines for GCC + Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008, 2010 + Free Software Foundation, Inc. Contributed by Gabriel Dos Reis 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,37 +16,30 @@ 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 +. */ #include "config.h" -#undef FLOAT /* This is for hpux. They should change hpux. */ -#undef FFS /* Some systems define this in param.h. */ #include "system.h" #include "coretypes.h" #include "tm.h" -#include "rtl.h" +#include "rtl-error.h" #include "insn-attr.h" #include "insn-config.h" #include "input.h" -#include "toplev.h" #include "intl.h" #include "diagnostic.h" -static void file_and_line_for_asm PARAMS ((rtx, const char **, int *)); -static void diagnostic_for_asm PARAMS ((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 file and line of the given INSN. */ -static void -file_and_line_for_asm (insn, pfile, pline) - rtx insn; - const char **pfile; - int *pline; +/* Figure the location of the given INSN. */ +static location_t +location_for_asm (const_rtx insn) { rtx body = PATTERN (insn); rtx asmop; + location_t loc; /* Find the (or one of the) ASM_OPERANDS in the insn. */ if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS) @@ -62,64 +56,49 @@ file_and_line_for_asm (insn, pfile, pline) asmop = NULL; if (asmop) - { - *pfile = ASM_OPERANDS_SOURCE_FILE (asmop); - *pline = ASM_OPERANDS_SOURCE_LINE (asmop); - } + loc = ASM_OPERANDS_SOURCE_LOCATION (asmop); else - { - *pfile = input_filename; - *pline = input_line; - } + loc = input_location; + return loc; } -/* Report a diagnostic MESSAGE (an errror or a WARNING) at the line number +/* Report a diagnostic MESSAGE (an error or a WARNING) at the line number 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 (insn, msg, args_ptr, kind) - rtx insn; - const char *msg; - va_list *args_ptr; - diagnostic_t kind; +diagnostic_for_asm (const_rtx insn, const char *msg, va_list *args_ptr, + diagnostic_t kind) { diagnostic_info diagnostic; - diagnostic_set_info (&diagnostic, msg, args_ptr, NULL, 0, kind); - file_and_line_for_asm (insn, &diagnostic.location.file, - &diagnostic.location.line); + diagnostic_set_info (&diagnostic, msg, args_ptr, + location_for_asm (insn), kind); report_diagnostic (&diagnostic); } void -error_for_asm VPARAMS ((rtx insn, const char *msgid, ...)) +error_for_asm (const_rtx insn, const char *gmsgid, ...) { - VA_OPEN (ap, msgid); - VA_FIXEDARG (ap, rtx, insn); - VA_FIXEDARG (ap, const char *, msgid); + va_list ap; - diagnostic_for_asm (insn, msgid, &ap, DK_ERROR); - VA_CLOSE (ap); + va_start (ap, gmsgid); + diagnostic_for_asm (insn, gmsgid, &ap, DK_ERROR); + va_end (ap); } void -warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...)) +warning_for_asm (const_rtx insn, const char *gmsgid, ...) { - VA_OPEN (ap, msgid); - VA_FIXEDARG (ap, rtx, insn); - VA_FIXEDARG (ap, const char *, msgid); + va_list ap; - diagnostic_for_asm (insn, msgid, &ap, DK_WARNING); - VA_CLOSE (ap); + va_start (ap, gmsgid); + diagnostic_for_asm (insn, gmsgid, &ap, DK_WARNING); + va_end (ap); } void -_fatal_insn (msgid, insn, file, line, function) - const char *msgid; - rtx insn; - const char *file; - int line; - const char *function; +_fatal_insn (const char *msgid, const_rtx insn, const char *file, int line, + const char *function) { error ("%s", _(msgid)); @@ -132,11 +111,8 @@ _fatal_insn (msgid, insn, file, line, function) } void -_fatal_insn_not_found (insn, file, line, function) - rtx insn; - const char *file; - int line; - const char *function; +_fatal_insn_not_found (const_rtx insn, const char *file, int line, + const char *function) { if (INSN_CODE (insn) < 0) _fatal_insn ("unrecognizable insn:", insn, file, line, function); @@ -144,4 +120,3 @@ _fatal_insn_not_found (insn, file, line, function) _fatal_insn ("insn does not satisfy its constraints:", insn, file, line, function); } -