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 stmt.c: Remove use of xxx_with_file_and_file.


This removes xxx_with_file_and_file from stmt.c.

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

-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.17736
diff -p -r1.17736 ChangeLog
*** ChangeLog	8 May 2003 16:27:20 -0000	1.17736
--- ChangeLog	8 May 2003 17:00:49 -0000
***************
*** 1,5 ****
--- 1,17 ----
  2003-05-08  Gabriel Dos Reis  <gdr@integrable-solutions.net>
  
+ 	* stmt.c (emit_locus): New macro.
+ 	(emit_filename): Remove.
+ 	(emit_lineno): Likewise.
+ 	(struct stmt_status): Replace members x_emit_filename and
+ 	x_emit_lineno with x_emit_locus.
+ 	(set_file_and_line_for_stmt): Adjust.
+ 	(expand_expr_stmt_value): Don't use warning_with_file_and_file.
+ 	(warn_if_unused_value): Likewise.
+ 	(check_seenlabel): Likewise.
+ 
+ 2003-05-08  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+ 
  	* c-decl.c (define_label): Tidy.  Don't use any of
  	error_with_file_and_line or warning_with_file_and_file.
  	(pending_xref_error): Likewise.
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.301
diff -p -r1.301 stmt.c
*** stmt.c	7 May 2003 21:14:47 -0000	1.301
--- stmt.c	8 May 2003 17:00:52 -0000
*************** struct stmt_status GTY(())
*** 366,375 ****
       always compute a value for each expr-stmt in case it is the last one.  */
    int x_expr_stmts_for_value;
  
!   /* Filename and line number of last line-number note,
!      whether we actually emitted it or not.  */
!   const char *x_emit_filename;
!   int x_emit_lineno;
  
    struct goto_fixup *x_goto_fixup_chain;
  };
--- 366,374 ----
       always compute a value for each expr-stmt in case it is the last one.  */
    int x_expr_stmts_for_value;
  
!   /* Location of last line-number note, whether we actually
!      emitted it or not.  */
!   location_t x_emit_locus;
  
    struct goto_fixup *x_goto_fixup_chain;
  };
*************** struct stmt_status GTY(())
*** 385,392 ****
  #define last_expr_type (cfun->stmt->x_last_expr_type)
  #define last_expr_value (cfun->stmt->x_last_expr_value)
  #define expr_stmts_for_value (cfun->stmt->x_expr_stmts_for_value)
! #define emit_filename (cfun->stmt->x_emit_filename)
! #define emit_lineno (cfun->stmt->x_emit_lineno)
  #define goto_fixup_chain (cfun->stmt->x_goto_fixup_chain)
  
  /* Nonzero if we are using EH to handle cleanups.  */
--- 384,390 ----
  #define last_expr_type (cfun->stmt->x_last_expr_type)
  #define last_expr_value (cfun->stmt->x_last_expr_value)
  #define expr_stmts_for_value (cfun->stmt->x_expr_stmts_for_value)
! #define emit_locus (cfun->stmt->x_emit_locus)
  #define goto_fixup_chain (cfun->stmt->x_goto_fixup_chain)
  
  /* Nonzero if we are using EH to handle cleanups.  */
*************** set_file_and_line_for_stmt (file, line)
*** 474,481 ****
       update it.  */
    if (cfun->stmt)
      {
!       emit_filename = file;
!       emit_lineno = line;
      }
  }
  
--- 472,479 ----
       update it.  */
    if (cfun->stmt)
      {
!       emit_locus.file = file;
!       emit_locus.line = line;
      }
  }
  
*************** expand_expr_stmt_value (exp, want_value,
*** 2200,2207 ****
  	  if (warn_unused_value
  	      && !(TREE_CODE (exp) == CONVERT_EXPR
  		   && VOID_TYPE_P (TREE_TYPE (exp))))
! 	    warning_with_file_and_line (emit_filename, emit_lineno,
! 				        "statement with no effect");
  	}
        else if (warn_unused_value)
  	warn_if_unused_value (exp);
--- 2198,2204 ----
  	  if (warn_unused_value
  	      && !(TREE_CODE (exp) == CONVERT_EXPR
  		   && VOID_TYPE_P (TREE_TYPE (exp))))
! 	    warning ("%Hstatement with no effect", &emit_locus);
  	}
        else if (warn_unused_value)
  	warn_if_unused_value (exp);
*************** warn_if_unused_value (exp)
*** 2361,2368 ****
        if (TREE_SIDE_EFFECTS (exp))
  	return 0;
  
!       warning_with_file_and_line (emit_filename, emit_lineno,
! 				  "value computed is not used");
        return 1;
      }
  }
--- 2358,2364 ----
        if (TREE_SIDE_EFFECTS (exp))
  	return 0;
  
!       warning ("%Hvalue computed is not used", &emit_locus);
        return 1;
      }
  }
*************** check_seenlabel ()
*** 4507,4516 ****
  
  	      /* If insn is zero, then there must have been a syntax error.  */
  	      if (insn)
! 		warning_with_file_and_line (NOTE_SOURCE_FILE (insn),
! 					    NOTE_LINE_NUMBER (insn),
! 					    "unreachable code at beginning of %s",
! 					    case_stack->data.case_stmt.printname);
  	      break;
  	    }
  	}
--- 4503,4515 ----
  
  	      /* If insn is zero, then there must have been a syntax error.  */
  	      if (insn)
!                 {
!                   location_t locus;
!                   locus.file = NOTE_SOURCE_FILE (insn);
!                   locus.line = NOTE_LINE_NUMBER (insn);
!                   warning ("%Hunreachable code at beginning of %s", &locus,
!                            case_stack->data.case_stmt.printname);
!                 }
  	      break;
  	    }
  	}


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