Commit 49468c8b by Gabriel Dos Reis Committed by Gabriel Dos Reis

c-parse.in (if_stmt_locus): New object.

	* c-parse.in (if_stmt_locus): New object.
	(if_prefix rule): Use it.  Don't use warning_with_file_and_line.
	(select_or_iter_stmt rule): Likewise.
	(if_stmt_file): Remove.
	(if_stmt_line): Likewise.
	* jump.c: include "diagnostic.h"
	(never_reached_warning): Don't use warning_with_file_and_line.
	* Makefile.in (jump.o): Add dependce on diagnostic.h

From-SVN: r66627
parent 2c478ce3
2003-05-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-parse.in (if_stmt_locus): New object.
(if_prefix rule): Use it. Don't use warning_with_file_and_line.
(select_or_iter_stmt rule): Likewise.
(if_stmt_file): Remove.
(if_stmt_line): Likewise.
* jump.c: include "diagnostic.h"
(never_reached_warning): Don't use warning_with_file_and_line.
* Makefile.in (jump.o): Add dependce on diagnostic.h
2003-05-09 Alan Modra <amodra@bigpond.net.au> 2003-05-09 Alan Modra <amodra@bigpond.net.au>
* expr.c (move_block_from_reg): Remove "size" parm. Localize vars. * expr.c (move_block_from_reg): Remove "size" parm. Localize vars.
......
...@@ -1578,7 +1578,8 @@ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $ ...@@ -1578,7 +1578,8 @@ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $
$(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \ hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H) toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H) \
diagnostic.h
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ $(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
......
...@@ -261,10 +261,10 @@ end ifobjc ...@@ -261,10 +261,10 @@ end ifobjc
static int stmt_count; static int stmt_count;
static int compstmt_count; static int compstmt_count;
/* Input file and line number of the end of the body of last simple_if; /* Input location of the end of the body of last simple_if;
used by the stmt-rule immediately after simple_if returns. */ used by the stmt-rule immediately after simple_if returns. */
static const char *if_stmt_file; static location_t if_stmt_locus;
static int if_stmt_line;
/* List of types and structure classes of the current declaration. */ /* List of types and structure classes of the current declaration. */
static GTY(()) tree current_declspecs; static GTY(()) tree current_declspecs;
...@@ -2215,8 +2215,8 @@ if_prefix: ...@@ -2215,8 +2215,8 @@ if_prefix:
{ c_expand_start_cond (c_common_truthvalue_conversion ($4), { c_expand_start_cond (c_common_truthvalue_conversion ($4),
compstmt_count,$<ttype>2); compstmt_count,$<ttype>2);
$<itype>$ = stmt_count; $<itype>$ = stmt_count;
if_stmt_file = $<filename>-2; if_stmt_locus.file = $<filename>-2;
if_stmt_line = $<lineno>-1; } if_stmt_locus.line = $<lineno>-1; }
; ;
/* This is a subroutine of stmt. /* This is a subroutine of stmt.
...@@ -2305,8 +2305,8 @@ select_or_iter_stmt: ...@@ -2305,8 +2305,8 @@ select_or_iter_stmt:
else statement. Increment stmt_count so we don't else statement. Increment stmt_count so we don't
give a second error if this is a nested `if'. */ give a second error if this is a nested `if'. */
if (extra_warnings && stmt_count++ == $<itype>1) if (extra_warnings && stmt_count++ == $<itype>1)
warning_with_file_and_line (if_stmt_file, if_stmt_line, warning ("%Hempty body in an if-statement",
"empty body in an if-statement"); } &if_stmt_locus); }
/* Make sure c_expand_end_cond is run once /* Make sure c_expand_end_cond is run once
for each call to c_expand_start_cond. for each call to c_expand_start_cond.
Otherwise a crash is likely. */ Otherwise a crash is likely. */
......
...@@ -54,6 +54,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -54,6 +54,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "reload.h" #include "reload.h"
#include "predict.h" #include "predict.h"
#include "timevar.h" #include "timevar.h"
#include "diagnostic.h"
/* Optimize jump y; x: ... y: jumpif... x? /* Optimize jump y; x: ... y: jumpif... x?
Don't know if it is worth bothering with. */ Don't know if it is worth bothering with. */
...@@ -1951,9 +1952,12 @@ never_reached_warning (avoided_insn, finish) ...@@ -1951,9 +1952,12 @@ never_reached_warning (avoided_insn, finish)
reached_end = 1; reached_end = 1;
} }
if (two_avoided_lines && contains_insn) if (two_avoided_lines && contains_insn)
warning_with_file_and_line (NOTE_SOURCE_FILE (a_line_note), {
NOTE_LINE_NUMBER (a_line_note), location_t locus;
"will never be executed"); locus.file = NOTE_SOURCE_FILE (a_line_note);
locus.line = NOTE_LINE_NUMBER (a_line_note);
warning ("%Hwill never be executed", &locus);
}
} }
/* Throughout LOC, redirect OLABEL to NLABEL. Treat null OLABEL or /* Throughout LOC, redirect OLABEL to NLABEL. Treat null OLABEL or
......
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