@@ -588,7 +588,7 @@ c_strlen (tree src, int only_value)
&& (only_value || !TREE_SIDE_EFFECTS (TREE_OPERAND (src, 0))))
return c_strlen (TREE_OPERAND (src, 1), only_value);
- loc = EXPR_LOC_OR_HERE (src);
+ loc = EXPR_LOC_OR_LOC (src, input_location);
src = string_constant (src, &offset_node);
if (src == 0)
@@ -515,7 +515,7 @@ internal_get_tmp_var (tree val, gimple_seq *pre_p, gimple_seq *post_p,
mod = build2 (INIT_EXPR, TREE_TYPE (t), t, unshare_expr (val));
- SET_EXPR_LOCATION (mod, EXPR_LOC_OR_HERE (val));
+ SET_EXPR_LOCATION (mod, EXPR_LOC_OR_LOC (val, input_location));
/* gimplify_modify_expr might want to reduce this further. */
gimplify_and_add (mod, pre_p);
@@ -2514,7 +2514,7 @@ shortcut_cond_expr (tree expr)
while (TREE_CODE (pred) == TRUTH_ANDIF_EXPR)
{
/* Keep the original source location on the first 'if'. */
- location_t locus = EXPR_LOC_OR_HERE (expr);
+ location_t locus = EXPR_LOC_OR_LOC (expr, input_location);
TREE_OPERAND (expr, 0) = TREE_OPERAND (pred, 1);
/* Set the source location of the && on the second 'if'. */
if (EXPR_HAS_LOCATION (pred))
@@ -2536,7 +2536,7 @@ shortcut_cond_expr (tree expr)
while (TREE_CODE (pred) == TRUTH_ORIF_EXPR)
{
/* Keep the original source location on the first 'if'. */
- location_t locus = EXPR_LOC_OR_HERE (expr);
+ location_t locus = EXPR_LOC_OR_LOC (expr, input_location);
TREE_OPERAND (expr, 0) = TREE_OPERAND (pred, 1);
/* Set the source location of the || on the second 'if'. */
if (EXPR_HAS_LOCATION (pred))
@@ -2600,7 +2600,7 @@ shortcut_cond_expr (tree expr)
/* If there was nothing else in our arms, just forward the label(s). */
if (!then_se && !else_se)
return shortcut_cond_r (pred, true_label_p, false_label_p,
- EXPR_LOC_OR_HERE (expr));
+ EXPR_LOC_OR_LOC (expr, input_location));
/* If our last subexpression already has a terminal label, reuse it. */
if (else_se)
@@ -2632,7 +2632,7 @@ shortcut_cond_expr (tree expr)
jump_over_else = block_may_fallthru (then_);
pred = shortcut_cond_r (pred, true_label_p, false_label_p,
- EXPR_LOC_OR_HERE (expr));
+ EXPR_LOC_OR_LOC (expr, input_location));
expr = NULL;
append_to_statement_list (pred, &expr);
@@ -39,7 +39,8 @@ diagnostic_report_current_function (diagnostic_context *context,
diagnostic_info *diagnostic)
{
diagnostic_report_current_module (context, diagnostic->location);
- lang_hooks.print_error_function (context, input_filename, diagnostic);
+ lang_hooks.print_error_function (context, LOCATION_FILE (input_location),
+ diagnostic);
}
static void
@@ -9101,7 +9101,7 @@ get_file_function_name (const char *type)
{
const char *file = main_input_filename;
if (! file)
- file = input_filename;
+ file = LOCATION_FILE (input_location);
/* Just use the file's basename, because the full pathname
might be quite long. */
p = q = ASTRDUP (lbasename (file));
@@ -9118,7 +9118,7 @@ get_file_function_name (const char *type)
if (! name)
name = "";
if (! file)
- file = input_filename;
+ file = LOCATION_FILE (input_location);
len = strlen (file);
q = (char *) alloca (9 + 17 + len + 1);