@@ -2552,7 +2552,7 @@ unsafe_conversion_p (tree type, tree expr, bool produce_warns)
{
enum conversion_safety give_warning = SAFE_CONVERSION; /* is 0 or false */
tree expr_type = TREE_TYPE (expr);
- location_t loc = EXPR_LOC_OR_HERE (expr);
+ location_t loc = EXPR_LOC_OR_LOC (expr, input_location);
if (TREE_CODE (expr) == REAL_CST || TREE_CODE (expr) == INTEGER_CST)
{
@@ -2718,7 +2718,7 @@ static void
conversion_warning (tree type, tree expr)
{
tree expr_type = TREE_TYPE (expr);
- location_t loc = EXPR_LOC_OR_HERE (expr);
+ location_t loc = EXPR_LOC_OR_LOC (expr, input_location);
enum conversion_safety conversion_kind;
if (!warn_conversion && !warn_sign_conversion && !warn_float_conversion)
@@ -2791,7 +2791,7 @@ conversion_warning (tree type, tree expr)
void
warnings_for_convert_and_check (tree type, tree expr, tree result)
{
- location_t loc = EXPR_LOC_OR_HERE (expr);
+ location_t loc = EXPR_LOC_OR_LOC (expr, input_location);
if (TREE_CODE (expr) == INTEGER_CST
&& (TREE_CODE (type) == INTEGER_TYPE
@@ -3001,7 +3001,7 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list,
&& (!only_writes || list->writer))
{
warned_ids = new_tlist (warned_ids, written, NULL_TREE);
- warning_at (EXPR_LOC_OR_HERE (writer),
+ warning_at (EXPR_LOC_OR_LOC (writer, input_location),
OPT_Wsequence_point, "operation on %qE may be undefined",
list->expr);
}
@@ -3999,7 +3999,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
int real1, real2;
tree primop0, primop1;
enum tree_code code = *rescode_ptr;
- location_t loc = EXPR_LOC_OR_HERE (op0);
+ location_t loc = EXPR_LOC_OR_LOC (op0, input_location);
/* Throw away any conversions to wider types
already present in the operands. */
@@ -4297,7 +4297,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
the comparison isn't an issue, so suppress the
warning. */
bool warn =
- warn_type_limits && !in_system_header
+ warn_type_limits && !in_system_header_at (loc)
&& c_inhibit_evaluation_warnings == 0
&& !(TREE_CODE (primop0) == INTEGER_CST
&& !TREE_OVERFLOW (convert (c_common_signed_type (type),
@@ -147,7 +147,7 @@ dump_one_header (splay_tree_node n, void * ARG_UNUSED (dummy))
void
dump_time_statistics (void)
{
- struct c_fileinfo *file = get_fileinfo (input_filename);
+ struct c_fileinfo *file = get_fileinfo (LOCATION_FILE (input_location));
int this_time = get_run_time ();
file->time += this_time - body_time;
@@ -243,7 +243,7 @@ cb_def_pragma (cpp_reader *pfile, source_location loc)
/* Issue a warning message if we have been asked to do so. Ignore
unknown pragmas in system headers unless an explicit
-Wunknown-pragmas has been given. */
- if (warn_unknown_pragmas > in_system_header)
+ if (warn_unknown_pragmas > in_system_header_at (input_location))
{
const unsigned char *space, *name;
const cpp_token *s;
@@ -1071,7 +1071,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string, bool translate)
if (concats)
strs = XOBFINISH (&str_ob, cpp_string *);
- if (concats && !objc_string && !in_system_header)
+ if (concats && !objc_string && !in_system_header_at (input_location))
warning (OPT_Wtraditional,
"traditional C rejects string constant concatenation");
@@ -1121,7 +1121,7 @@ handle_pragma_float_const_decimal64 (cpp_reader *ARG_UNUSED (dummy))
{
if (c_dialect_cxx ())
{
- if (warn_unknown_pragmas > in_system_header)
+ if (warn_unknown_pragmas > in_system_header_at (input_location))
warning (OPT_Wunknown_pragmas,
"%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
" for C++");
@@ -1130,7 +1130,7 @@ handle_pragma_float_const_decimal64 (cpp_reader *ARG_UNUSED (dummy))
if (!targetm.decimal_float_supported_p ())
{
- if (warn_unknown_pragmas > in_system_header)
+ if (warn_unknown_pragmas > in_system_header_at (input_location))
warning (OPT_Wunknown_pragmas,
"%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
" on this target");