summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/rtl-error.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2004-07-28 03:11:36 +0000
committerkan <kan@FreeBSD.org>2004-07-28 03:11:36 +0000
commit5e00ec74d8ce58f99801200d4d3d0412c7cc1b28 (patch)
tree052f4bb635f2bea2c5e350bd60c902be100a0d1e /contrib/gcc/rtl-error.c
parent87b8398a7d9f9bf0e28bbcd54a4fc27db2125f38 (diff)
downloadFreeBSD-src-5e00ec74d8ce58f99801200d4d3d0412c7cc1b28.zip
FreeBSD-src-5e00ec74d8ce58f99801200d4d3d0412c7cc1b28.tar.gz
Gcc 3.4.2 20040728.
Diffstat (limited to 'contrib/gcc/rtl-error.c')
-rw-r--r--contrib/gcc/rtl-error.c77
1 files changed, 30 insertions, 47 deletions
diff --git a/contrib/gcc/rtl-error.c b/contrib/gcc/rtl-error.c
index 2b660c9..72ef094 100644
--- a/contrib/gcc/rtl-error.c
+++ b/contrib/gcc/rtl-error.c
@@ -1,5 +1,5 @@
-/* RTL specific diagnostic subroutines for the GNU C compiler
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* RTL specific diagnostic subroutines for GCC
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
This file is part of GCC.
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#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 "insn-attr.h"
#include "insn-config.h"
@@ -31,19 +33,16 @@ Boston, MA 02111-1307, USA. */
#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 (rtx);
+static void diagnostic_for_asm (rtx, const char *, va_list *, diagnostic_t);
-/* 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 (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)
@@ -61,63 +60,51 @@ file_and_line_for_asm (insn, pfile, pline)
if (asmop)
{
- *pfile = ASM_OPERANDS_SOURCE_FILE (asmop);
- *pline = ASM_OPERANDS_SOURCE_LINE (asmop);
+ loc.file = ASM_OPERANDS_SOURCE_FILE (asmop);
+ loc.line = ASM_OPERANDS_SOURCE_LINE (asmop);
}
else
- {
- *pfile = input_filename;
- *pline = lineno;
- }
+ loc = input_location;
+ return loc;
}
/* Report a diagnostic MESSAGE (an errror 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 (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 (rtx insn, const char *msgid, ...)
{
- VA_OPEN (ap, msgid);
- VA_FIXEDARG (ap, rtx, insn);
- VA_FIXEDARG (ap, const char *, msgid);
+ va_list ap;
+ va_start (ap, msgid);
diagnostic_for_asm (insn, msgid, &ap, DK_ERROR);
- VA_CLOSE (ap);
+ va_end (ap);
}
void
-warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
+warning_for_asm (rtx insn, const char *msgid, ...)
{
- VA_OPEN (ap, msgid);
- VA_FIXEDARG (ap, rtx, insn);
- VA_FIXEDARG (ap, const char *, msgid);
+ va_list ap;
+ va_start (ap, msgid);
diagnostic_for_asm (insn, msgid, &ap, DK_WARNING);
- VA_CLOSE (ap);
+ 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, rtx insn, const char *file, int line,
+ const char *function)
{
error ("%s", _(msgid));
@@ -130,11 +117,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 (rtx insn, const char *file, int line,
+ const char *function)
{
if (INSN_CODE (insn) < 0)
_fatal_insn ("unrecognizable insn:", insn, file, line, function);
@@ -142,4 +126,3 @@ _fatal_insn_not_found (insn, file, line, function)
_fatal_insn ("insn does not satisfy its constraints:",
insn, file, line, function);
}
-
OpenPOWER on IntegriCloud