This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[mainline] PATCH to jump.c, c-parse.in: Remove xxx_with_file_and_line


This completes the removal of xxx_with_file_and_file from the C
familly front-ends.  Next on the radar screen: xxx_with_decl.

It would be helpful if we could have DECL_SOURCE_LOCATION equivalent
for insn NOTEs.  

Bootstrapped and regtested on an i686-pc-linux-gnu.

-- Gaby

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.17742
diff -p -r1.17742 ChangeLog
*** ChangeLog	9 May 2003 06:37:14 -0000	1.17742
--- ChangeLog	9 May 2003 09:23:28 -0000
***************
*** 1,3 ****
--- 1,14 ----
+ 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>
  
  	* expr.c (move_block_from_reg): Remove "size" parm.  Localize vars.
Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.157
diff -p -r1.157 c-parse.in
*** c-parse.in	1 May 2003 16:13:27 -0000	1.157
--- c-parse.in	9 May 2003 09:23:29 -0000
*************** end ifobjc
*** 261,270 ****
  static int stmt_count;
  static int compstmt_count;
  
! /* Input file and line number of the end of the body of last simple_if;
     used by the stmt-rule immediately after simple_if returns.  */
! static const char *if_stmt_file;
! static int if_stmt_line;
  
  /* List of types and structure classes of the current declaration.  */
  static GTY(()) tree current_declspecs;
--- 261,270 ----
  static int stmt_count;
  static int compstmt_count;
  
! /* Input location of the end of the body of last simple_if;
     used by the stmt-rule immediately after simple_if returns.  */
! static location_t if_stmt_locus;
! 
  
  /* List of types and structure classes of the current declaration.  */
  static GTY(()) tree current_declspecs;
*************** if_prefix:
*** 2215,2222 ****
  		{ c_expand_start_cond (c_common_truthvalue_conversion ($4),
  				       compstmt_count,$<ttype>2);
  		  $<itype>$ = stmt_count;
! 		  if_stmt_file = $<filename>-2;
! 		  if_stmt_line = $<lineno>-1; }
          ;
  
  /* This is a subroutine of stmt.
--- 2215,2222 ----
  		{ c_expand_start_cond (c_common_truthvalue_conversion ($4),
  				       compstmt_count,$<ttype>2);
  		  $<itype>$ = stmt_count;
! 		  if_stmt_locus.file = $<filename>-2;
! 		  if_stmt_locus.line = $<lineno>-1; }
          ;
  
  /* This is a subroutine of stmt.
*************** select_or_iter_stmt:
*** 2305,2312 ****
  		     else statement.  Increment stmt_count so we don't
  		     give a second error if this is a nested `if'.  */
  		  if (extra_warnings && stmt_count++ == $<itype>1)
! 		    warning_with_file_and_line (if_stmt_file, if_stmt_line,
! 						"empty body in an if-statement"); }
  /* Make sure c_expand_end_cond is run once
     for each call to c_expand_start_cond.
     Otherwise a crash is likely.  */
--- 2305,2312 ----
  		     else statement.  Increment stmt_count so we don't
  		     give a second error if this is a nested `if'.  */
  		  if (extra_warnings && stmt_count++ == $<itype>1)
! 		    warning ("%Hempty body in an if-statement",
!                              &if_stmt_locus); }
  /* Make sure c_expand_end_cond is run once
     for each call to c_expand_start_cond.
     Otherwise a crash is likely.  */
Index: jump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/jump.c,v
retrieving revision 1.223
diff -p -r1.223 jump.c
*** jump.c	29 Apr 2003 20:25:11 -0000	1.223
--- jump.c	9 May 2003 09:23:31 -0000
*************** Software Foundation, 59 Temple Place - S
*** 54,59 ****
--- 54,60 ----
  #include "reload.h"
  #include "predict.h"
  #include "timevar.h"
+ #include "diagnostic.h"
  
  /* Optimize jump y; x: ... y: jumpif... x?
     Don't know if it is worth bothering with.  */
*************** never_reached_warning (avoided_insn, fin
*** 1951,1959 ****
  	reached_end = 1;
      }
    if (two_avoided_lines && contains_insn)
!     warning_with_file_and_line (NOTE_SOURCE_FILE (a_line_note),
! 				NOTE_LINE_NUMBER (a_line_note),
! 				"will never be executed");
  }
  
  /* Throughout LOC, redirect OLABEL to NLABEL.  Treat null OLABEL or
--- 1952,1963 ----
  	reached_end = 1;
      }
    if (two_avoided_lines && contains_insn)
!     {
!       location_t locus;
!       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
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1050
diff -p -r1.1050 Makefile.in
*** Makefile.in	9 May 2003 06:37:17 -0000	1.1050
--- Makefile.in	9 May 2003 09:23:33 -0000
*************** integrate.o : integrate.c $(CONFIG_H) $(
*** 1578,1584 ****
     $(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 \
     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)
  
  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 \
--- 1578,1585 ----
     $(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 \
     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) \
!    diagnostic.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 \
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]