1f978f5f7e
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
145 lines
3.9 KiB
C
145 lines
3.9 KiB
C
/* RTL specific diagnostic subroutines for the GNU C compiler
|
|
Copyright (C) 2001 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)
|
|
any later version.
|
|
|
|
GCC is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
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. */
|
|
|
|
#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 "rtl.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 *, int));
|
|
|
|
/* 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;
|
|
{
|
|
rtx body = PATTERN (insn);
|
|
rtx asmop;
|
|
|
|
/* 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);
|
|
else if (GET_CODE (body) == ASM_OPERANDS)
|
|
asmop = body;
|
|
else if (GET_CODE (body) == PARALLEL
|
|
&& GET_CODE (XVECEXP (body, 0, 0)) == SET)
|
|
asmop = SET_SRC (XVECEXP (body, 0, 0));
|
|
else if (GET_CODE (body) == PARALLEL
|
|
&& GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
|
|
asmop = XVECEXP (body, 0, 0);
|
|
else
|
|
asmop = NULL;
|
|
|
|
if (asmop)
|
|
{
|
|
*pfile = ASM_OPERANDS_SOURCE_FILE (asmop);
|
|
*pline = ASM_OPERANDS_SOURCE_LINE (asmop);
|
|
}
|
|
else
|
|
{
|
|
*pfile = input_filename;
|
|
*pline = lineno;
|
|
}
|
|
}
|
|
|
|
/* 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, warn)
|
|
rtx insn;
|
|
const char *msg;
|
|
va_list *args_ptr;
|
|
int warn;
|
|
{
|
|
diagnostic_context dc;
|
|
|
|
set_diagnostic_context (&dc, msg, args_ptr, NULL, 0, warn);
|
|
file_and_line_for_asm (insn, &diagnostic_file_location (&dc),
|
|
&diagnostic_line_location (&dc));
|
|
report_diagnostic (&dc);
|
|
}
|
|
|
|
void
|
|
error_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
|
|
{
|
|
VA_OPEN (ap, msgid);
|
|
VA_FIXEDARG (ap, rtx, insn);
|
|
VA_FIXEDARG (ap, const char *, msgid);
|
|
|
|
diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 0);
|
|
VA_CLOSE (ap);
|
|
}
|
|
|
|
void
|
|
warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
|
|
{
|
|
VA_OPEN (ap, msgid);
|
|
VA_FIXEDARG (ap, rtx, insn);
|
|
VA_FIXEDARG (ap, const char *, msgid);
|
|
|
|
diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 1);
|
|
VA_CLOSE (ap);
|
|
}
|
|
|
|
void
|
|
_fatal_insn (msgid, insn, file, line, function)
|
|
const char *msgid;
|
|
rtx insn;
|
|
const char *file;
|
|
int line;
|
|
const char *function;
|
|
{
|
|
error ("%s", _(msgid));
|
|
|
|
/* The above incremented error_count, but isn't an error that we want to
|
|
count, so reset it here. */
|
|
errorcount--;
|
|
|
|
debug_rtx (insn);
|
|
fancy_abort (file, line, function);
|
|
}
|
|
|
|
void
|
|
_fatal_insn_not_found (insn, file, line, function)
|
|
rtx insn;
|
|
const char *file;
|
|
int line;
|
|
const char *function;
|
|
{
|
|
if (INSN_CODE (insn) < 0)
|
|
_fatal_insn ("unrecognizable insn:", insn, file, line, function);
|
|
else
|
|
_fatal_insn ("insn does not satisfy its constraints:",
|
|
insn, file, line, function);
|
|
}
|
|
|