aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl-error.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-06-28 16:23:29 +0000
committerNathan Sidwell <nathan@codesourcery.com>2003-06-28 16:23:29 +0000
commit641ba754b8f8068950d1a68c32c5d82670968737 (patch)
tree38b43c524490adad24cd4d5c9105cbbdd3fca991 /gcc/rtl-error.c
parent0fac207e81e5b8fe789523168bcb0ce33c770ae8 (diff)
* diagnostic.h (diagnostic_set_info): Replace file and lineno
parameters with a location_t. * diagnostic.c (diagnostic_set_info): Replace file and lineno parameters with a location_t. (inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl): Adjust. * c-error.c (pedwarn_c99): Adjust. * c-format.c (status_warning): Adjust. * rtl-error.c (file_and_line_for_asm): Rename to ... (location_for_asm): Return a location_t. (diagnostic_for_asm): Adjust. * cp/cp-tree.h (cp_line_of, cp_file_of): Remove. * cp/error.c (cp_line_of, cp_file_of): Merge into ... (location_of): ... here. Make static, return a location_t. (cp_error_at, cp_warning_at, cp_pedwarn_at): Adjust. * testsuite/g++.old-deja/g++.robertl/eb133.C: Set expected line number. * testsuite/g++.old-deja/g++.robertl/eb133a.C: Likewise. * testsuite/g++.old-deja/g++.robertl/eb133b.C: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@68643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl-error.c')
-rw-r--r--gcc/rtl-error.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/gcc/rtl-error.c b/gcc/rtl-error.c
index 5be5cd55849..028cedd2ca1 100644
--- a/gcc/rtl-error.c
+++ b/gcc/rtl-error.c
@@ -33,20 +33,19 @@ Boston, MA 02111-1307, USA. */
#include "intl.h"
#include "diagnostic.h"
-static void file_and_line_for_asm PARAMS ((rtx, const char **, int *));
+static location_t location_for_asm PARAMS ((rtx));
static void diagnostic_for_asm PARAMS ((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)
+/* Figure the location of the given INSN. */
+static location_t
+location_for_asm (insn)
rtx insn;
- const char **pfile;
- int *pline;
{
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)
asmop = SET_SRC (body);
@@ -63,14 +62,12 @@ 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 = input_line;
- }
+ loc = input_location;
+ return loc;
}
/* Report a diagnostic MESSAGE (an errror or a WARNING) at the line number
@@ -84,10 +81,9 @@ diagnostic_for_asm (insn, msg, args_ptr, kind)
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);
}