Commit 8f246310 by Richard Sandiford Committed by Richard Sandiford

read-md.h (fatal_at): Declare.

gcc/
	* read-md.h (fatal_at): Declare.
	* read-md.c (fatal_at): New function.
	* genattrtab.c (insn_def, attr_desc, delay_desc): Use a file_location
	to record the source position.
	(check_attr_test): Take a file_location instead of a line number.
	Use fatal_at instead of fatal.
	(check_attr_value): Update after above changes, using "at"
	rather than "with_line" reporting functions.
	(convert_set_attr_alternative): Likewise.
	(gen_attr): Likewise.
	(check_defs): Likewise.  Don't assign to read_md_filename.
	(gen_insn): Update initialization after above changes.
	(gen_delay): Likewise.
	(write_insn_cases): Print the filename for a define_peephole.
	(gen_insn_reserv): Take a line number as argument and update
	the call to check_attr_test.
	(main): Pass a line number to gen_insn_reserv.

From-SVN: r225880
parent cc472607
2015-07-16 Richard Sandiford <richard.sandiford@arm.com>
* read-md.h (fatal_at): Declare.
* read-md.c (fatal_at): New function.
* genattrtab.c (insn_def, attr_desc, delay_desc): Use a file_location
to record the source position.
(check_attr_test): Take a file_location instead of a line number.
Use fatal_at instead of fatal.
(check_attr_value): Update after above changes, using "at"
rather than "with_line" reporting functions.
(convert_set_attr_alternative): Likewise.
(gen_attr): Likewise.
(check_defs): Likewise. Don't assign to read_md_filename.
(gen_insn): Update initialization after above changes.
(gen_delay): Likewise.
(write_insn_cases): Print the filename for a define_peephole.
(gen_insn_reserv): Take a line number as argument and update
the call to check_attr_test.
(main): Pass a line number to gen_insn_reserv.
2015-07-16 Richard Sandiford <richard.sandiford@arm.com>
* read-md.h (file_location): New structure.
(directive_handler_t): Take a file_location rather than a line number.
(message_at, error_at): Declare.
......
......@@ -277,6 +277,19 @@ error_at (file_location loc, const char *msg, ...)
have_error = 1;
}
/* Like message_at, but treat the condition as a fatal error. */
void
fatal_at (file_location loc, const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
message_at_1 (loc, msg, ap);
va_end (ap);
exit (1);
}
/* A printf-like function for reporting an error against line LINENO
in the current MD file. */
......
......@@ -136,6 +136,7 @@ extern void print_c_condition (const char *);
extern void fprint_c_condition (FILE *, const char *);
extern void message_at (file_location, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void error_at (file_location, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void fatal_at (file_location, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void message_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void error_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void fatal_with_file_and_line (const char *, ...)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment