* c-decl.c (pending_invalid_xref_file): Remove.
(pending_invalid_xref_line): Remove.
(pending_invalid_xref_location): New.
(lookup_label): Use location_t and input_location directly.
(lookup_tag): Likewise.
(pending_xref_error): Likewise.
(c_expand_body_1): Likewise.
* c-common.c (x_expand_start_cond): Likewise.
* c-semantics.c (genrtl_for_stmt): Likewise.
(find_reachable_label): Likewise.
* expr.c (expand_expr): Likewise.
* integrate.c (output_inline_function): Likewise.
* tree-inline.c (find_alloca_call): Likewise.
(find_builtin_longjmp_call): Likewise.
* gcc.c (input_filename): Make static.
From-SVN: r66425
+2003-05-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-decl.c (pending_invalid_xref_file): Remove.
+ (pending_invalid_xref_line): Remove.
+ (pending_invalid_xref_location): New.
+ (lookup_label): Use location_t and input_location directly.
+ (lookup_tag): Likewise.
+ (pending_xref_error): Likewise.
+ (c_expand_body_1): Likewise.
+ * c-common.c (x_expand_start_cond): Likewise.
+ * c-semantics.c (genrtl_for_stmt): Likewise.
+ (find_reachable_label): Likewise.
+ * expr.c (expand_expr): Likewise.
+ * integrate.c (output_inline_function): Likewise.
+ * tree-inline.c (find_alloca_call): Likewise.
+ (find_builtin_longjmp_call): Likewise.
+ * gcc.c (input_filename): Make static.
+
2003-05-03 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.md: Fix comment typo.
/* Record this if statement. */
if_stack[if_stack_pointer].compstmt_count = compstmt_count;
- if_stack[if_stack_pointer].locus.file = input_filename;
- if_stack[if_stack_pointer].locus.line = input_line;
+ if_stack[if_stack_pointer].locus = input_location;
if_stack[if_stack_pointer].needs_warning = 0;
if_stack[if_stack_pointer].if_stmt = if_stmt;
if_stack_pointer++;
tree pending_invalid_xref;
/* File and line to appear in the eventual error message. */
-const char *pending_invalid_xref_file;
-int pending_invalid_xref_line;
+location_t pending_invalid_xref_location;
/* While defining an enum type, this is 1 plus the last enumerator
constant value. Note that will do not have to save this or `enum_overflow'
/* Say where one reference is to the label,
for the sake of the error if it is not defined. */
- DECL_SOURCE_LINE (decl) = input_line;
- DECL_SOURCE_FILE (decl) = input_filename;
+ DECL_SOURCE_LOCATION (decl) = input_location;
IDENTIFIER_LABEL_VALUE (id) = decl;
{
/* Definition isn't the kind we were looking for. */
pending_invalid_xref = name;
- pending_invalid_xref_file = input_filename;
- pending_invalid_xref_line = input_line;
+ pending_invalid_xref_location = input_location;
/* If in the same binding level as a declaration as a tag
of a different type, this must not be allowed to
pending_xref_error ()
{
if (pending_invalid_xref != 0)
- error_with_file_and_line (pending_invalid_xref_file,
- pending_invalid_xref_line,
+ error_with_file_and_line (pending_invalid_xref_location.file,
+ pending_invalid_xref_location.line,
"`%s' defined as wrong kind of tag",
IDENTIFIER_POINTER (pending_invalid_xref));
pending_invalid_xref = 0;
/* Initialize the RTL code for the function. */
current_function_decl = fndecl;
- input_filename = DECL_SOURCE_FILE (fndecl);
+ input_location = DECL_SOURCE_LOCATION (fndecl);
init_function_start (fndecl, input_filename, DECL_SOURCE_LINE (fndecl));
- input_line = DECL_SOURCE_LINE (fndecl);
/* This function is being processed in whole-function mode. */
cfun->x_whole_function_mode_p = 1;
tree t;
{
tree cond = FOR_COND (t);
- const char *saved_filename;
- int saved_lineno;
+ location_t saved_loc;
if (NEW_FOR_SCOPE_P (t))
genrtl_do_pushlevel ();
/* Save the filename and line number so that we expand the FOR_EXPR
we can reset them back to the saved values. */
- saved_filename = input_filename;
- saved_lineno = input_line;
+ saved_loc = input_location;
/* Expand the condition. */
if (cond && !integer_nonzerop (cond))
expand_stmt (FOR_BODY (t));
/* Expand the increment expression. */
- input_filename = saved_filename;
- input_line = saved_lineno;
+ input_location = saved_loc;
emit_line_note (input_filename, input_line);
if (FOR_EXPR (t))
{
find_reachable_label (exp)
tree exp;
{
- int line = input_line;
- const char *file = input_filename;
+ location_t saved_loc = input_location;
tree ret = walk_tree (&exp, find_reachable_label_1, NULL, NULL);
- input_filename = file;
- input_line = line;
+ input_location = saved_loc;
return ret;
}
case EXPR_WITH_FILE_LOCATION:
{
rtx to_return;
- const char *saved_input_filename = input_filename;
- int saved_lineno = input_line;
+ location_t saved_loc = input_location;
input_filename = EXPR_WFL_FILENAME (exp);
input_line = EXPR_WFL_LINENO (exp);
if (EXPR_WFL_EMIT_LINE_NOTE (exp))
emit_line_note (input_filename, input_line);
/* Possibly avoid switching back and forth here. */
to_return = expand_expr (EXPR_WFL_NODE (exp), target, tmode, modifier);
- input_filename = saved_input_filename;
- input_line = saved_lineno;
+ input_location = saved_loc;
return to_return;
}
sans all directory names, and basename_length is the number
of characters starting there excluding the suffix .c or whatever. */
-const char *input_filename;
+static const char *input_filename;
static int input_file_number;
size_t input_filename_length;
static int basename_length;
/* Make sure warnings emitted by the optimizers (e.g. control reaches
end of non-void function) is not wildly incorrect. */
- input_filename = DECL_SOURCE_FILE (fndecl);
- input_line = DECL_SOURCE_LINE (fndecl);
+ input_location = DECL_SOURCE_LOCATION (fndecl);
/* Compile this function all the way down to assembly code. As a
side effect this destroys the saved RTL representation, but
}
}
-/* Save the current INPUT_FILENAME and LINENO on the top entry in the
+/* Save the current INPUT_LOCATION on the top entry in the
INPUT_FILE_STACK. Push a new entry for FILE and LINE, and set the
- INPUT_FILENAME and LINENO accordingly. */
+ INPUT_LOCATION accordingly. */
void
push_srcloc (file, line)
}
/* Pop the top entry off the stack of presently open source files.
- Restore the INPUT_FILENAME and LINENO from the new topmost entry on
- the stack. */
+ Restore the INPUT_LOCATION from the new topmost entry on the
+ stack. */
void
pop_srcloc ()
find_alloca_call (exp)
tree exp;
{
- int line = input_line;
- const char *file = input_filename;
+ location_t saved_loc = input_location;
tree ret = walk_tree (&exp, find_alloca_call_1, NULL, NULL);
- input_line = line;
- input_filename = file;
+ input_location = saved_loc;
return ret;
}
find_builtin_longjmp_call (exp)
tree exp;
{
- int line = input_line;
- const char *file = input_filename;
+ location_t saved_loc = input_location;
tree ret = walk_tree (&exp, find_builtin_longjmp_call_1, NULL, NULL);
- input_line = line;
- input_filename = file;
+ input_location = saved_loc;
return ret;
}