+2008-02-26 Tom Tromey <tromey@redhat.com>
+
+ * system.h (USE_MAPPED_LOCATION): Poison.
+ * Makefile.in (GTFILES): Put CPP_ID_DATA_H first.
+ * tree-cfg.c (make_cond_expr_edges): Remove old location code.
+ (make_goto_expr_edges): Likewise.
+ (remove_bb): Likewise.
+ (execute_warn_function_return): Likewise.
+ * basic-block.h (struct edge_def) <goto_locus>: Change type to
+ location_t.
+ * c-common.c (fname_decl): Remove old location code.
+ * tree-vect-transform.c (vect_finish_stmt_generation): Remove old
+ location code.
+ * rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location
+ variant.
+ (ASM_INPUT_SOURCE_LOCATION): Likewise.
+ (gen_rtx_ASM_INPUT): Likewise.
+ (gen_rtx_ASM_INPUT_loc): Likewise.
+ (get_rtx_asm_OPERANDS): Remove.
+ * cfglayout.c (insn_locators_alloc): Remove old location code.
+ (set_curr_insn_source_location): Likewise.
+ (curr_insn_locator): Likewise.
+ * print-tree.c (print_node): Remove old location code.
+ * tree-mudflap.c (mf_varname_tree): Remove old location code.
+ (mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION.
+ * cfgexpand.c (expand_gimple_cond_expr): Don't use
+ location_from_locus.
+ (construct_exit_block): Remove old location code.
+ * emit-rtl.c (force_next_line_note): Remove old location code.
+ * profile.c (branch_prob): Remove old location code.
+ * tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE,
+ LOC_LINE): Remove old-location variants.
+ * langhooks.c (lhd_print_error_function): Remove old location
+ code.
+ * configure, config.in: Rebuilt.
+ * configure.ac (--enable-mapped-location): Remove.
+ * c-decl.c (c_init_decl_processing): Remove old location code.
+ (finish_function): Likewise.
+ * recog.c (decode_asm_operands): Remove old location code.
+ * c-pch.c (c_common_read_pch): Remove old location code.
+ * rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location
+ variants.
+ * gimple-low.c (lower_function_body): Remove old location code.
+ * toplev.c (unknown_location): Remove.
+ (push_srcloc): Remove old-location variant.
+ (process_options): Remove old location code.
+ (lang_dependent_init): Likewise.
+ * input.h (UNKNOWN_LOCATION): Move definition.
+ (location_t): Undeprecate.
+ (source_locus): Remove.
+ (location_from_locus): Remove.
+ (struct location_s): Remove.
+ Remove all old-location code.
+ (input_line, input_filename): Remove.
+ * final.c (final_scan_insn): Remove old location code.
+ * diagnostic.c (diagnostic_build_prefix): Remove
+ USE_MAPPED_LOCATION test.
+ * tree.h (gimple_stmt) <locus>: Now a location_t.
+ (tree_exp) <locus>: Likewise.
+ (DECL_IS_BUILTIN): Remove old-location variant.
+ (annotate_with_file_line, annotate_with_locus): Likewise.
+ (expr_locus, set_expr_locus): Update.
+ * tree.c (build1_stat): Remove old location code.
+ (last_annotated_node): Remove.
+ (annotate_with_file_line): Remove old-location variant.
+ (annotate_with_locus): Likewise.
+ (expr_location): Remove old location code.
+ (set_expr_location): Likewise.
+ (expr_has_location): Likewise.
+ (expr_locus): Likewise.
+ (set_expr_locus): Likewise.
+ (expr_filename): Don't use location_from_locus.
+ (expr_lineno): Likewise.
+ * rtl-error.c (location_for_asm): Remove old location code.
+ * c-lex.c (cb_line_change): Remove old location code.
+ (fe_file_change): Likewise.
+ (cb_def_pragma): Likewise.
+ (c_lex_with_flags): Likewise.
+ * gengtype.c (do_typedef): Don't special-case location types.
+ (define_location_structures): Remove.
+ (main): Don't call define_location_structures.
+ * tree-pretty-print.c (dump_implicit_edges): Remove old location
+ code.
+
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 26264
$(SHELL) $(srcdir)/../move-if-change tmp-constrs.h tm-constrs.h
$(STAMP) s-constrs-h
-GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
- $(CPP_ID_DATA_H) $(host_xm_file_list) \
+GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
+ $(host_xm_file_list) \
$(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
$(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \
$(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \
+2008-02-26 Tom Tromey <tromey@redhat.com>
+
+ * misc.c (internal_error_function): Remove test of
+ USE_MAPPED_LOCATION.
+ * trans.c (gigi): Remove test of USE_MAPPED_LOCATION.
+ (Sloc_to_locus): Remove old location code.
+
2008-02-25 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* gnat_rm.texi, gnat_ugn.texi: Fix spacing after `e.g.' and
fp.Array = buffer;
s = expand_location (input_location);
-#ifdef USE_MAPPED_LOCATION
if (flag_show_column && s.column != 0)
asprintf (&loc, "%s:%d:%d", s.file, s.line, s.column);
else
-#endif
asprintf (&loc, "%s:%d", s.file, s.line);
temp_loc.Low_Bound = 1;
temp_loc.High_Bound = strlen (loc);
type_annotate_only = (gigi_operating_mode == 1);
-#ifdef USE_MAPPED_LOCATION
for (i = 0; i < number_files; i++)
{
/* Use the identifier table to make a permanent copy of the filename as
linemap_position_for_column (line_table, 252 - 1);
linemap_add (line_table, LC_LEAVE, 0, NULL, 0);
}
-#endif
/* Initialize ourselves. */
init_code_table ();
return false;
if (Sloc <= Standard_Location)
-#ifdef USE_MAPPED_LOCATION
{
*locus = BUILTINS_LOCATION;
return false;
+ ((line - map->to_line) << map->column_bits)
+ (column & ((1 << map->column_bits) - 1));
}
-#else
- return false;
-
- /* Use the identifier table to make a hashed, permanent copy of the filename,
- since the name table gets reallocated after Gigi returns but before all
- the debugging information is output. The __gnat_to_canonical_file_spec
- call translates filenames from pragmas Source_Reference that contain host
- style syntax not understood by gdb. */
- locus->file
- = IDENTIFIER_POINTER
- (get_identifier
- (__gnat_to_canonical_file_spec
- (Get_Name_String (Full_Debug_Name (Get_Source_File_Index (Sloc))))));
-
- locus->line = Get_Logical_Line_Number (Sloc);
-#endif
ref_filename
= IDENTIFIER_POINTER
/* Define control and data flow tables, and regsets.
Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
PTR GTY ((skip (""))) aux;
/* Location of any goto implicit in the edge, during tree-ssa. */
- source_locus goto_locus;
+ location_t goto_locus;
/* The index number corresponding to this edge in the edge vector
dest->preds. */
it from appearing in the RTL. */
tree stmts;
location_t saved_location = input_location;
-#ifdef USE_MAPPED_LOCATION
input_location = UNKNOWN_LOCATION;
-#else
- input_line = 0;
-#endif
stmts = push_stmt_list ();
decl = (*make_fname_decl) (id, fname_vars[ix].pretty);
/* Declarations from c_common_nodes_and_builtins must not be associated
with this input file, lest we get differences between using and not
using preprocessed headers. */
-#ifdef USE_MAPPED_LOCATION
input_location = BUILTINS_LOCATION;
-#else
- input_location.file = "<built-in>";
- input_location.line = 0;
-#endif
build_common_tree_nodes (flag_signed_char, false);
if (flag_isoc99)
{
tree stmt = c_finish_return (integer_zero_node);
-#ifdef USE_MAPPED_LOCATION
/* Hack. We don't want the middle-end to warn that this return
is unreachable, so we mark its location as special. Using
UNKNOWN_LOCATION has the problem that it gets clobbered in
ensure ! should_carry_locus_p (stmt), but that needs a flag.
*/
SET_EXPR_LOCATION (stmt, BUILTINS_LOCATION);
-#else
- /* Hack. We don't want the middle-end to warn that this
- return is unreachable, so put the statement on the
- special line 0. */
- annotate_with_file_line (stmt, input_filename, 0);
-#endif
}
}
}
/* Mainly the interface between cpplib and the C front ends.
Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
int parsing_args)
{
if (token->type != CPP_EOF && !parsing_args)
-#ifdef USE_MAPPED_LOCATION
input_location = token->src_loc;
-#else
- {
- source_location loc = token->src_loc;
- const struct line_map *map = linemap_lookup (line_table, loc);
- input_line = SOURCE_LINE (map, loc);
- }
-#endif
}
void
we already did in compile_file. */
if (!MAIN_FILE_P (new_map))
{
-#ifdef USE_MAPPED_LOCATION
int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1);
input_location = included_at;
push_srcloc (new_map->start_location);
-#else
- int included_at = LAST_SOURCE_LINE (new_map - 1);
-
- input_line = included_at;
- push_srcloc (new_map->to_file, 1);
-#endif
(*debug_hooks->start_source_file) (included_at, new_map->to_file);
#ifndef NO_IMPLICIT_EXTERN_C
if (c_header_level)
update_header_times (new_map->to_file);
in_system_header = new_map->sysp != 0;
-#ifdef USE_MAPPED_LOCATION
input_location = new_map->start_location;
-#else
- input_filename = new_map->to_file;
- input_line = new_map->to_line;
-#endif
}
static void
{
const unsigned char *space, *name;
const cpp_token *s;
-#ifndef USE_MAPPED_LOCATION
- location_t fe_loc;
- const struct line_map *map = linemap_lookup (line_table, loc);
- fe_loc.file = map->to_file;
- fe_loc.line = SOURCE_LINE (map, loc);
-#else
location_t fe_loc = loc;
-#endif
space = name = (const unsigned char *) "";
s = cpp_get_token (pfile);
timevar_push (TV_CPP);
retry:
-#ifdef USE_MAPPED_LOCATION
tok = cpp_get_token_with_location (parse_in, loc);
-#else
- tok = cpp_get_token (parse_in);
- *loc = input_location;
-#endif
type = tok->type;
retry_after_at:
/* An @ may give the next token special significance in Objective-C. */
if (c_dialect_objc ())
{
-#ifdef USE_MAPPED_LOCATION
location_t atloc = *loc;
location_t newloc;
-#else
- location_t atloc = input_location;
-#endif
retry_at:
-#ifdef USE_MAPPED_LOCATION
tok = cpp_get_token_with_location (parse_in, &newloc);
-#else
- tok = cpp_get_token (parse_in);
-#endif
type = tok->type;
switch (type)
{
default:
/* ... or not. */
error ("%Hstray %<@%> in program", &atloc);
-#ifdef USE_MAPPED_LOCATION
*loc = newloc;
-#endif
goto retry_after_at;
}
break;
/* Precompiled header implementation for the C languages.
- Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
}
/* Save the location and then restore it after reading the PCH. */
-#ifdef USE_MAPPED_LOCATION
saved_loc = expand_location (line_table->highest_line);
-#else
- {
- const struct line_map *map = linemap_lookup (line_table,
- line_table->highest_line);
- saved_loc.file = map->to_file;
- saved_loc.line = SOURCE_LINE (map, line_table->highest_line);
- }
-#endif
cpp_prepare_state (pfile, &smd);
/* A pass for lowering trees to RTL.
- Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
add_reg_br_prob_note (last, true_edge->probability);
maybe_dump_rtl_for_tree_stmt (stmt, last);
if (true_edge->goto_locus)
- set_curr_insn_source_location (location_from_locus (true_edge->goto_locus));
+ set_curr_insn_source_location (true_edge->goto_locus);
false_edge->flags |= EDGE_FALLTHRU;
return NULL;
}
add_reg_br_prob_note (last, false_edge->probability);
maybe_dump_rtl_for_tree_stmt (stmt, last);
if (false_edge->goto_locus)
- set_curr_insn_source_location (location_from_locus (false_edge->goto_locus));
+ set_curr_insn_source_location (false_edge->goto_locus);
true_edge->flags |= EDGE_FALLTHRU;
return NULL;
}
maybe_dump_rtl_for_tree_stmt (stmt, last2);
if (false_edge->goto_locus)
- set_curr_insn_source_location (location_from_locus (false_edge->goto_locus));
+ set_curr_insn_source_location (false_edge->goto_locus);
return new_bb;
}
{
emit_jump (label_rtx_for_bb (e->dest));
if (e->goto_locus)
- set_curr_insn_source_location (location_from_locus (e->goto_locus));
+ set_curr_insn_source_location (e->goto_locus);
e->flags &= ~EDGE_FALLTHRU;
}
/* Make sure the locus is set to the end of the function, so that
epilogue line numbers and warnings are set properly. */
-#ifdef USE_MAPPED_LOCATION
if (cfun->function_end_locus != UNKNOWN_LOCATION)
-#else
- if (cfun->function_end_locus.file)
-#endif
input_location = cfun->function_end_locus;
/* The following insns belong to the top scope. */
/* Basic block reordering routines for the GNU compiler.
- Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
locations_locators_locs = VEC_alloc (int, heap, 32);
locations_locators_vals = VEC_alloc (location_t, heap, 32);
-#ifdef USE_MAPPED_LOCATION
last_location = -1;
curr_location = -1;
-#else
- last_location.line = -1;
- curr_location.line = -1;
-#endif
curr_block = NULL;
last_block = NULL;
curr_rtl_loc = 0;
time locators are not initialized. */
if (curr_rtl_loc == -1)
return;
-#ifdef USE_MAPPED_LOCATION
if (location == last_location)
return;
-#else
- if (location.file && last_location.file
- && !strcmp (location.file, last_location.file)
- && location.line == last_location.line)
- return;
-#endif
curr_location = location;
}
VEC_safe_push (tree, gc, block_locators_blocks, curr_block);
last_block = curr_block;
}
-#ifdef USE_MAPPED_LOCATION
if (last_location != curr_location)
-#else
- if (last_location.file != curr_location.file
- || last_location.line != curr_location.line)
-#endif
{
curr_rtl_loc++;
VEC_safe_push (int, heap, locations_locators_locs, curr_rtl_loc);
#endif
-/* Define if location_t is fileline integer cookie. */
-#ifndef USED_FOR_TARGET
-#undef USE_MAPPED_LOCATION
-#endif
-
-
/* Define to be the last component of the Windows registry key under which to
look for installation paths. The full key used will be
HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}.
Categories are: yes,no,all,none,release.
Flags are: assert,df,fold,gc,gcac,misc,
rtlflag,rtl,runtime,tree,valgrind,types.
- --enable-mapped-location location_t is fileline integer cookie
--enable-coverage=LEVEL
enable compiler's code coverage collection.
Use to measure compiler performance and locate
-# Check whether --enable-mapped-location or --disable-mapped-location was given.
-if test "${enable_mapped_location+set}" = set; then
- enableval="$enable_mapped_location"
-
-else
- enable_mapped_location=yes
-fi;
-
-if test "$enable_mapped_location" = yes ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_MAPPED_LOCATION 1
-_ACEOF
-
-fi
-
# Enable code coverage collection
# Check whether --enable-coverage or --disable-coverage was given.
if test "${enable_coverage+set}" = set; then
AC_SUBST(valgrind_path_defines)
AC_SUBST(valgrind_command)
-AC_ARG_ENABLE(mapped-location,
-[ --enable-mapped-location location_t is fileline integer cookie],,
-enable_mapped_location=yes)
-
-if test "$enable_mapped_location" = yes ; then
- AC_DEFINE(USE_MAPPED_LOCATION, 1,
-[Define if location_t is fileline integer cookie.])
-fi
-
# Enable code coverage collection
AC_ARG_ENABLE(coverage,
[ --enable-coverage[=LEVEL]
+2008-02-26 Tom Tromey <tromey@redhat.com>
+
+ * parser.c (eof_token): Remove old location code.
+ (check_empty_body): Remove test of USE_MAPPED_LOCATION.
+ * decl2.c (generate_ctor_or_dtor_function): Remove old location
+ code.
+ (cp_write_global_declarations): Likewise.
+ * lex.c (cxx_init): Remove old location code.
+ (handle_pragma_implementation): Remove test of
+ USE_MAPPED_LOCATION.
+ * pt.c (tsubst): Remove old location code.
+ * error.c (cp_print_error_function): Remove test of
+ USE_MAPPED_LOCATION.
+ * decl.c (pop_label): Remove old location code.
+ (finish_function): Likewise.
+
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 26264
location_t location;
error ("label %q+D used but not defined", label);
-#ifdef USE_MAPPED_LOCATION
location = input_location; /* FIXME want (input_filename, (line)0) */
-#else
- location.file = input_filename;
- location.line = 0;
-#endif
/* Avoid crashing later. */
define_label (location, DECL_NAME (label));
}
/* Hack. We don't want the middle-end to warn that this
return is unreachable, so put the statement on the
special line 0. */
-#ifdef USE_MAPPED_LOCATION
{
location_t linezero = linemap_line_start (line_table, 0, 1);
SET_EXPR_LOCATION (stmt, linezero);
}
-#else
- annotate_with_file_line (stmt, input_filename, 0);
-#endif
}
if (use_eh_spec_block (current_function_decl))
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
size_t i;
input_location = *locus;
-#ifdef USE_MAPPED_LOCATION
/* ??? */
-#else
- locus->line++;
-#endif
+ /* Was: locus->line++; */
/* We use `I' to indicate initialization and `D' to indicate
destruction. */
if (pch_file)
c_common_write_pch ();
-#ifdef USE_MAPPED_LOCATION
- /* FIXME - huh? */
-#else
- /* Otherwise, GDB can get confused, because in only knows
- about source for LINENO-1 lines. */
- input_line -= 1;
-#endif
+ /* FIXME - huh? was input_line -= 1;*/
/* We now have to write out all the stuff we put off writing out.
These include:
instantiations, etc. */
reconsider = true;
ssdf_count++;
-#ifdef USE_MAPPED_LOCATION
- /* ??? */
-#else
- locus.line++;
-#endif
+ /* ??? was: locus.line++; */
}
/* Go through the set of inline functions whose bodies have not
pp_base_newline (context->printer);
if (s.file != NULL)
{
-#ifdef USE_MAPPED_LOCATION
if (flag_show_column && s.column != 0)
pp_printf (context->printer,
" inlined from %qs at %s:%d:%d",
cxx_printable_name (fndecl, 2),
s.file, s.line, s.column);
else
-#endif
pp_printf (context->printer,
" inlined from %qs at %s:%d",
cxx_printable_name (fndecl, 2),
/* Separate lexical analyzer for GNU C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
for (i = 0; i < ARRAY_SIZE (stmt_codes); i++)
statement_code_p[stmt_codes[i]] = true;
- /* We cannot just assign to input_filename because it has already
- been initialized and will be used later as an N_BINCL for stabs+
- debugging. */
-#ifdef USE_MAPPED_LOCATION
push_srcloc (BUILTINS_LOCATION);
-#else
- push_srcloc ("<built-in>", 0);
-#endif
init_reswords ();
init_tree ();
else
{
filename = ggc_strdup (TREE_STRING_POINTER (fname));
-#ifdef USE_MAPPED_LOCATION
- /* We currently cannot give this diagnostic, as we reach this point
- only after cpplib has scanned the entire translation unit, so
- cpp_included always returns true. A plausible fix is to compare
- the current source-location cookie with the first source-location
- cookie (if any) of the filename, but this requires completing the
- --enable-mapped-location project first. See PR 17577. */
if (cpp_included_before (parse_in, filename, input_location))
warning (0, "#pragma implementation for %qs appears after "
"file is included", filename);
-#endif
}
for (; ifiles; ifiles = ifiles->next)
static cp_token eof_token =
{
CPP_EOF, RID_MAX, 0, PRAGMA_NONE, 0, 0, false, 0, { NULL },
-#if USE_MAPPED_LOCATION
0
-#else
- {0, 0}
-#endif
};
/* The cp_lexer structure represents the C++ lexer. It is responsible
semi_loc = expand_location (token->location);
if (close_loc.line == semi_loc.line
-#ifdef USE_MAPPED_LOCATION
- && close_loc.column+1 == semi_loc.column
-#endif
- )
+ && close_loc.column+1 == semi_loc.column)
warning (OPT_Wempty_body,
"suggest a space before %<;%> or explicit braces around empty "
"body in %<%s%> statement",
message to avoid spewing a ton of messages during a
single bad template instantiation. */
if (complain & tf_error
-#ifdef USE_MAPPED_LOCATION
- && last_loc != input_location
-#else
- && (last_loc.line != input_line
- || last_loc.file != input_filename)
-#endif
- )
+ && last_loc != input_location)
{
if (TREE_CODE (type) == VOID_TYPE)
error ("forming reference to void");
/* Language-independent diagnostic subroutines for the GNU Compiler Collection
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
return
(s.file == NULL
? build_message_string ("%s: %s", progname, text)
-#ifdef USE_MAPPED_LOCATION
: flag_show_column && s.column != 0
? build_message_string ("%s:%d:%d: %s", s.file, s.line, s.column, text)
-#endif
: build_message_string ("%s:%d: %s", s.file, s.line, text));
}
/* Emit RTL for the GCC expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
void
force_next_line_note (void)
{
-#ifdef USE_MAPPED_LOCATION
last_location = -1;
-#else
- last_location.line = -1;
-#endif
}
/* Place a note of KIND on insn INSN with DATUM as the datum. If a
/* Convert RTL to assembler code and output it, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
fputs (ASM_APP_ON, file);
app_on = 1;
}
-#ifdef USE_MAPPED_LOCATION
loc = expand_location (ASM_INPUT_SOURCE_LOCATION (body));
-#else
- loc.file = ASM_INPUT_SOURCE_FILE (body);
- loc.line = ASM_INPUT_SOURCE_LINE (body);
-#endif
if (*loc.file && loc.line)
fprintf (asm_out_file, "%s %i \"%s\" 1\n",
ASM_COMMENT_START, loc.line, loc.file);
+2008-02-26 Tom Tromey <tromey@redhat.com>
+
+ * trans-io.c (set_error_locus): Remove old location code.
+ * trans-decl.c (gfc_set_decl_location): Remove old location code.
+ * f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION.
+ * scanner.c (gfc_gobble_whitespace): Remove old location code.
+ (get_file): Likewise.
+ (preprocessor_line): Likewise.
+ (load_file): Likewise.
+ (gfc_new_file): Likewise.
+ * trans.c (gfc_trans_runtime_check): Remove old location code.
+ (gfc_get_backend_locus): Likewise.
+ (gfc_set_backend_locus): Likewise.
+ * data.c (gfc_assign_data_value): Remove old location code.
+ * error.c (show_locus): Remove old location code.
+ * gfortran.h (gfc_linebuf): Remove old location code.
+ (gfc_linebuf_linenum): Remove old-location variant.
+
2008-02-25 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/34729
/* Order in which the expressions arrive here depends on whether
they are from data statements or F95 style declarations.
Therefore, check which is the most recent. */
-#ifdef USE_MAPPED_LOCATION
expr = (LOCATION_LINE (init->where.lb->location)
> LOCATION_LINE (rvalue->where.lb->location))
? init : rvalue;
-#else
- expr = (init->where.lb->linenum > rvalue->where.lb->linenum)
- ? init : rvalue;
-#endif
gfc_notify_std (GFC_STD_GNU, "Extension: re-initialization "
"of '%s' at %L", symbol->name, &expr->where);
}
error_string (f->filename);
error_char (':');
-#ifdef USE_MAPPED_LOCATION
error_integer (LOCATION_LINE (lb->location));
-#else
- error_integer (lb->linenum);
-#endif
if ((c1 > 0) || (c2 > 0))
error_char ('.');
static bool
gfc_init (void)
{
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_ENTER, false, gfc_source_file, 1);
linemap_add (line_table, LC_RENAME, false, "<built-in>", 0);
-#endif
/* First initialize the backend. */
gfc_init_decl_processing ();
typedef struct gfc_linebuf
{
-#ifdef USE_MAPPED_LOCATION
source_location location;
-#else
- int linenum;
-#endif
struct gfc_file *file;
struct gfc_linebuf *next;
#define gfc_linebuf_header_size (offsetof (gfc_linebuf, line))
-#ifdef USE_MAPPED_LOCATION
#define gfc_linebuf_linenum(LBUF) (LOCATION_LINE ((LBUF)->location))
-#else
-#define gfc_linebuf_linenum(LBUF) ((LBUF)->linenum)
-#endif
typedef struct
{
line will be scanned multiple times. */
if (!gfc_option.warn_tabs && c == '\t')
{
-#ifdef USE_MAPPED_LOCATION
int cur_linenum = LOCATION_LINE (gfc_current_locus.lb->location);
-#else
- int cur_linenum = gfc_current_locus.lb->linenum;
-#endif
if (cur_linenum != linenum)
{
linenum = cur_linenum;
if (current_file != NULL)
f->inclusion_line = current_file->line;
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, reason, false, f->filename, 1);
-#endif
return f;
}
add_file_change (NULL, line);
current_file = current_file->up;
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_RENAME, false, current_file->filename,
current_file->line);
-#endif
}
/* The name of the file can be a temporary file produced by
b = gfc_getmem (gfc_linebuf_header_size + len + 1);
-#ifdef USE_MAPPED_LOCATION
b->location
= linemap_line_start (line_table, current_file->line++, 120);
-#else
- b->linenum = current_file->line++;
-#endif
b->file = current_file;
b->truncated = trunc;
strcpy (b->line, line);
if (!initial)
add_file_change (NULL, current_file->inclusion_line + 1);
current_file = current_file->up;
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, 0, NULL, 0);
-#endif
return SUCCESS;
}
#if 0 /* Debugging aid. */
for (; line_head; line_head = line_head->next)
gfc_status ("%s:%3d %s\n",
-#ifdef USE_MAPPED_LOCATION
LOCATION_FILE (line_head->location),
LOCATION_LINE (line_head->location),
-#else
- line_head->file->filename,
- line_head->linenum,
-#endif
line_head->line);
exit (0);
void
gfc_set_decl_location (tree decl, locus * loc)
{
-#ifdef USE_MAPPED_LOCATION
DECL_SOURCE_LOCATION (decl) = loc->lb->location;
-#else
- DECL_SOURCE_LINE (decl) = loc->lb->linenum;
- DECL_SOURCE_FILE (decl) = loc->lb->file->filename;
-#endif
}
str = gfc_build_addr_expr (pchar_type_node, str);
gfc_add_modify_expr (block, locus_file, str);
-#ifdef USE_MAPPED_LOCATION
line = LOCATION_LINE (where->lb->location);
-#else
- line = where->lb->linenum;
-#endif
set_parameter_const (block, var, IOPARM_common_line, line);
}
if (where)
{
-#ifdef USE_MAPPED_LOCATION
line = LOCATION_LINE (where->lb->location);
-#else
- line = where->lb->linenum;
-#endif
asprintf (&message, "At line %d of file %s", line,
where->lb->file->filename);
}
gfc_get_backend_locus (locus * loc)
{
loc->lb = gfc_getmem (sizeof (gfc_linebuf));
-#ifdef USE_MAPPED_LOCATION
loc->lb->location = input_location;
-#else
- loc->lb->linenum = input_line;
-#endif
loc->lb->file = gfc_current_backend_file;
}
gfc_set_backend_locus (locus * loc)
{
gfc_current_backend_file = loc->lb->file;
-#ifdef USE_MAPPED_LOCATION
input_location = loc->lb->location;
-#else
- input_line = loc->lb->linenum;
- input_filename = loc->lb->file->filename;
-#endif
}
/* Process source files and output type information.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
{
pair_p p;
- /* temporary kludge - gengtype doesn't handle conditionals or macros.
- Ignore any attempt to typedef CUMULATIVE_ARGS, location_t,
- expanded_location, or source_locus, unless it is coming from
- this file (main() sets them up with safe dummy definitions). */
- if ((!strcmp (s, "CUMULATIVE_ARGS")
- || !strcmp (s, "location_t")
- || !strcmp (s, "source_locus")
- || !strcmp (s, "source_location")
- || !strcmp (s, "expanded_location"))
- && pos->file != this_file)
+ /* temporary kludge - gengtype doesn't handle conditionals or
+ macros. Ignore any attempt to typedef CUMULATIVE_ARGS, unless it
+ is coming from this file (main() sets them up with safe dummy
+ definitions). */
+ if (!strcmp (s, "CUMULATIVE_ARGS") && pos->file != this_file)
return;
for (p = typedefs; p != NULL; p = p->next)
do_typedef (astratname, new_structure (astratname, 0, pos, field, 0), pos);
}
-/* Yet more temporary kludge since gengtype doesn't understand conditionals.
- This must be kept in sync with input.h. */
-static void
-define_location_structures (void)
-{
- pair_p fields;
- type_p locs;
- static struct fileloc pos = { this_file, __LINE__ };
- do_scalar_typedef ("source_location", &pos);
-
-#ifdef USE_MAPPED_LOCATION
- fields = create_field (0, &scalar_nonchar, "column");
- fields = create_field (fields, &scalar_nonchar, "line");
- fields = create_field (fields, &string_type, "file");
- locs = new_structure ("anon:expanded_location", 0, &pos, fields, 0);
-
- do_typedef ("expanded_location", locs, &pos);
- do_scalar_typedef ("location_t", &pos);
- do_scalar_typedef ("source_locus", &pos);
-#else
- fields = create_field (0, &scalar_nonchar, "line");
- fields = create_field (fields, &string_type, "file");
- locs = new_structure ("location_s", 0, &pos, fields, 0);
-
- do_typedef ("expanded_location", locs, &pos);
- do_typedef ("location_t", locs, &pos);
- do_typedef ("source_locus", create_pointer (locs), &pos);
-#endif
-}
-
\f
int
main (int argc, char **argv)
do_scalar_typedef ("JCF_u2", &pos); pos.line++;
do_scalar_typedef ("void", &pos); pos.line++;
do_typedef ("PTR", create_pointer (resolve_typedef ("void", &pos)), &pos);
- define_location_structures ();
for (i = 0; i < num_gt_files; i++)
parse_file (gt_files[i]);
/* Tree lowering pass. Lowers GIMPLE into unstructured form.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
It now fills in for many such returns. Failure to remove this
will result in incorrect results for coverage analysis. */
x = TREE_VALUE (t);
-#ifdef USE_MAPPED_LOCATION
SET_EXPR_LOCATION (x, UNKNOWN_LOCATION);
-#else
- SET_EXPR_LOCUS (x, NULL);
-#endif
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
}
/* Declarations for variables relating to reading the source file.
Used by parsers, lexical analyzers, and error message routines.
- Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007
+ Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
#define GCC_INPUT_H
#include "line-map.h"
+
extern GTY(()) struct line_maps *line_table;
+/* A value which will never be used to represent a real location. */
+#define UNKNOWN_LOCATION ((source_location) 0)
+
/* The location for declarations in "<built-in>" */
#define BUILTINS_LOCATION ((source_location) 2)
-/* Note: if any of the types defined inside this #ifdef are changed,
- gengtype.c:define_location_structures must be updated to match. */
-
-#ifdef USE_MAPPED_LOCATION
-
-typedef struct
+typedef struct GTY (())
{
/* The name of the source file involved. */
const char *file;
extern expanded_location expand_location (source_location);
-#define UNKNOWN_LOCATION ((source_location) 0)
-typedef source_location location_t; /* deprecated typedef */
-typedef source_location source_locus; /* to be removed */
-
-#define location_from_locus(LOCUS) (LOCUS)
-
-#else /* ! USE_MAPPED_LOCATION */
-
-struct location_s GTY(())
-{
- /* The name of the source file involved. */
- const char *file;
-
- /* The line-location in the source file. */
- int line;
-};
-
-typedef struct location_s expanded_location;
-typedef struct location_s location_t;
-typedef location_t *source_locus;
-
-#define expand_location(FILELINE) (FILELINE)
-extern location_t unknown_location;
-#define UNKNOWN_LOCATION unknown_location
-
-#define location_from_locus(LOCUS) (* (LOCUS))
-
-#endif /* ! USE_MAPPED_LOCATION */
+/* Historically GCC used location_t, while cpp used source_location.
+ This could be removed but it hardly seems worth the effort. */
+typedef source_location location_t;
struct file_stack
{
extern const char *main_input_filename;
extern location_t input_location;
-#ifdef USE_MAPPED_LOCATION
extern void push_srcloc (location_t);
-#else /* ! USE_MAPPED_LOCATION */
-extern void push_srcloc (const char *name, int line);
-#endif /* ! USE_MAPPED_LOCATION */
extern void pop_srcloc (void);
extern void restore_input_file_stack (int);
#define LOCATION_FILE(LOC) ((expand_location (LOC)).file)
#define LOCATION_LINE(LOC) ((expand_location (LOC)).line)
-#define input_line LOCATION_LINE(input_location)
-#define input_filename LOCATION_FILE(input_location)
+#define input_line LOCATION_LINE (input_location)
+#define input_filename LOCATION_FILE (input_location)
/* Stack of currently pending input files.
The line member is not accurate for the innermost file on the stack. */
+2008-02-26 Tom Tromey <tromey@redhat.com>
+
+ * lang.c (java_post_options): Remove conditional.
+ * expr.c (expand_byte_code): Remove old location code.
+ * jcf-parse.c (set_source_filename): Remove old location code.
+ (give_name_to_class): Likewise.
+ (jcf_parse): Likewise.
+ (duplicate_class_warning): Likewise.
+ (parse_class_file): Likewise.
+ (java_parse_file): Likewise.
+ * decl.c (finish_method): Remove old location code.
+ * class.c (push_class): Remove old location code.
+
2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR other/35107
/* Functions related to building classes and their related objects.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
{
tree decl, signature;
location_t saved_loc = input_location;
-#ifndef USE_MAPPED_LOCATION
- input_filename = "<unknown>";
- input_line = 0;
-#endif
CLASS_P (class_type) = 1;
decl = build_decl (TYPE_DECL, class_name, class_type);
TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
/* Process declarations and variables for the GNU compiler for the
Java(TM) language.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
set_cfun (DECL_STRUCT_FUNCTION (fndecl));
else
allocate_struct_function (fndecl, false);
-#ifdef USE_MAPPED_LOCATION
cfun->function_end_locus = DECL_FUNCTION_LAST_LINE (fndecl);
-#else
- cfun->function_end_locus.file = DECL_SOURCE_FILE (fndecl);
- cfun->function_end_locus.line = DECL_FUNCTION_LAST_LINE (fndecl);
-#endif
/* Defer inlining and expansion to the cgraph optimizers. */
cgraph_finalize_function (fndecl, false);
/* Process expressions for the GNU compiler for the Java(TM) language.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
if (pc == PC)
{
int line = GET_u2 (linenumber_pointer - 2);
-#ifdef USE_MAPPED_LOCATION
input_location = linemap_line_start (line_table, line, 1);
-#else
- input_location.line = line;
-#endif
if (!(instruction_bits[PC] & BCODE_HAS_MULTI_LINENUMBERS))
break;
}
/* Parser for Java(TM) .class files.
Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
&& strcmp (sfname, old_filename + old_len - new_len) == 0
&& (old_filename[old_len - new_len - 1] == '/'
|| old_filename[old_len - new_len - 1] == '\\'))
- {
-#ifndef USE_MAPPED_LOCATION
- input_filename = find_sourcefile (input_filename);
- DECL_SOURCE_LOCATION (TYPE_NAME (current_class)) = input_location;
- file_start_location = input_location;
-#endif
- return;
- }
+ return;
}
if (strchr (sfname, '/') == NULL && strchr (sfname, '\\') == NULL)
{
}
sfname = find_sourcefile (sfname);
-#ifdef USE_MAPPED_LOCATION
line_table->maps[line_table->used-1].to_file = sfname;
-#else
- input_filename = sfname;
- DECL_SOURCE_LOCATION (TYPE_NAME (current_class)) = input_location;
- file_start_location = input_location;
-#endif
if (current_class == main_class) main_input_filename = sfname;
}
tree class_name = unmangle_classname ((const char *) JPOOL_UTF_DATA (jcf, j),
JPOOL_UTF_LENGTH (jcf, j));
this_class = lookup_class (class_name);
-#ifdef USE_MAPPED_LOCATION
{
tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
const char *sfname = IDENTIFIER_POINTER (source_name);
if (main_input_filename == NULL && jcf == main_jcf)
main_input_filename = sfname;
}
-#else
- if (! DECL_ARTIFICIAL (TYPE_NAME (this_class)))
- {
- input_location = DECL_SOURCE_LOCATION (TYPE_NAME (this_class));
- if (main_input_filename == NULL && jcf == main_jcf)
- main_input_filename = input_filename;
- }
-#endif
jcf->cpool.data[i].t = this_class;
JPOOL_TAG (jcf, i) = CONSTANT_ResolvedClass;
if (TYPE_REFLECTION_DATA (current_class))
annotation_write_byte (JV_DONE_ATTR);
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, false, NULL, 0);
-#endif
/* The fields of class_type_node are already in correct order. */
if (current_class != class_type_node && current_class != object_type_node)
duplicate_class_warning (const char *filename)
{
location_t warn_loc;
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_RENAME, 0, filename, 0);
warn_loc = linemap_line_start (line_table, 0, 1);
-#else
- warn_loc.file = filename;
- warn_loc.line = 0;
-#endif
warning (0, "%Hduplicate class will only be compiled once", &warn_loc);
}
java_layout_seen_class_methods ();
input_location = DECL_SOURCE_LOCATION (TYPE_NAME (current_class));
-#ifdef USE_MAPPED_LOCATION
{
/* Re-enter the current file. */
expanded_location loc = expand_location (input_location);
linemap_add (line_table, LC_ENTER, 0, loc.file, loc.line);
}
-#endif
file_start_location = input_location;
(*debug_hooks->start_source_file) (input_line, input_filename);
if (min_line == 0 || line < min_line)
min_line = line;
}
-#ifdef USE_MAPPED_LOCATION
if (min_line != 0)
input_location = linemap_line_start (line_table, min_line, 1);
-#else
- if (min_line != 0)
- input_line = min_line;
-#endif
}
else
{
JCF_ZERO (main_jcf);
main_jcf->read_state = finput;
main_jcf->filbuf = jcf_filbuf_from_stdio;
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_ENTER, false, filename, 0);
input_location = linemap_line_start (line_table, 0, 1);
-#endif
if (open_in_zip (main_jcf, filename, NULL, 0) < 0)
fatal_error ("bad zip/jar file %s", filename);
localToFile = SeenZipFiles;
/* Register all the classes defined there. */
process_zip_dir (main_jcf->read_state);
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, false, NULL, 0);
-#endif
parse_zip_file_entries ();
}
else if (magic == (JCF_u4) ZIPEMPTYMAGIC)
parse_source_file_1 (real_file, filename, finput);
java_parser_context_restore_global ();
java_pop_parser_context (1);
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, false, NULL, 0);
-#endif
#endif
}
}
/* Java(TM) language-specific utility routines.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
}
}
}
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_ENTER, false, filename, 0);
linemap_add (line_table, LC_RENAME, false, "<built-in>", 0);
-#endif
/* Initialize the compiler back end. */
return false;
/* Default language-specific hooks.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
pp_newline (context->printer);
if (s.file != NULL)
{
-#ifdef USE_MAPPED_LOCATION
if (flag_show_column && s.column != 0)
pp_printf (context->printer,
_(" inlined from %qs at %s:%d:%d"),
lang_hooks.decl_printable_name (fndecl, 2),
s.file, s.line, s.column);
else
-#endif
pp_printf (context->printer,
_(" inlined from %qs at %s:%d"),
lang_hooks.decl_printable_name (fndecl, 2),
+2008-02-26 Tom Tromey <tromey@redhat.com>
+
+ * objc-act.c (objc_init): Remove old location code.
+
2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR other/35107
/* Implement classes and message passing for Objective C.
Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Steve Naroff.
This file is part of GCC.
#endif
return false;
-#ifndef USE_MAPPED_LOCATION
- /* Force the line number back to 0; check_newline will have
- raised it to 1, which will make the builtin functions appear
- not to be built in. */
- input_line = 0;
-#endif
-
/* If gen_declaration desired, open the output file. */
if (flag_gen_declaration)
{
/* Prints out tree in human readable form - GCC
Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
xloc = expand_location (DECL_SOURCE_LOCATION (node));
- fprintf (file, " file %s line %d", xloc.file, xloc.line);
-#ifdef USE_MAPPED_LOCATION
- fprintf (file, " col %d", xloc.column);
-#endif
+ fprintf (file, " file %s line %d col %d", xloc.file, xloc.line,
+ xloc.column);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{
{
expanded_location xloc = expand_location (EXPR_LOCATION (node));
indent_to (file, indent+4);
- fprintf (file, "%s:%d", xloc.file, xloc.line);
-#ifdef USE_MAPPED_LOCATION
- fprintf (file, ":%d", xloc.column);
-#endif
+ fprintf (file, "%s:%d:%d", xloc.file, xloc.line, xloc.column);
}
fprintf (file, ">");
/* Calculate branch probabilities, and basic block execution counts.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
based on some ideas from Dain Samples of UC Berkeley.
if (last && EXPR_LOCUS (last)
&& e->goto_locus
&& !single_succ_p (bb)
-#ifdef USE_MAPPED_LOCATION
&& (LOCATION_FILE (e->goto_locus)
!= LOCATION_FILE (EXPR_LOCATION (last))
|| (LOCATION_LINE (e->goto_locus)
!= LOCATION_LINE (EXPR_LOCATION (last)))))
-#else
- && (e->goto_locus->file != EXPR_LOCUS (last)->file
- || (e->goto_locus->line != EXPR_LOCUS (last)->line)))
-#endif
{
basic_block new = split_edge (e);
single_succ_edge (new)->goto_locus = e->goto_locus;
CFG. */
if (single_succ_p (bb) && single_succ_edge (bb)->goto_locus)
{
- /* ??? source_locus type is marked deprecated in input.h. */
- source_locus curr_location = single_succ_edge (bb)->goto_locus;
+ location_t curr_location = single_succ_edge (bb)->goto_locus;
/* ??? The FILE/LINE API is inconsistent for these cases. */
-#ifdef USE_MAPPED_LOCATION
output_location (LOCATION_FILE (curr_location),
LOCATION_LINE (curr_location), &offset, bb);
-#else
- output_location (curr_location->file, curr_location->line,
- &offset, bb);
-#endif
}
if (offset)
/* Subroutines used by or related to instruction recognition.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
}
if (loc)
- {
-#ifdef USE_MAPPED_LOCATION
- *loc = ASM_OPERANDS_SOURCE_LOCATION (asmop);
-#else
- loc->file = ASM_OPERANDS_SOURCE_FILE (asmop);
- loc->line = ASM_OPERANDS_SOURCE_LINE (asmop);
-#endif
- }
+ *loc = ASM_OPERANDS_SOURCE_LOCATION (asmop);
return ASM_OPERANDS_TEMPLATE (asmop);
}
/* RTL specific diagnostic subroutines for GCC
- Copyright (C) 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
This file is part of GCC.
asmop = NULL;
if (asmop)
-#ifdef USE_MAPPED_LOCATION
loc = ASM_OPERANDS_SOURCE_LOCATION (asmop);
-#else
- {
- loc.file = ASM_OPERANDS_SOURCE_FILE (asmop);
- loc.line = ASM_OPERANDS_SOURCE_LINE (asmop);
- }
-#endif
else
loc = input_location;
return loc;
Register Transfer Expressions (rtx's) that make up the
Register Transfer Language (rtl) used in the Back End of the GNU compiler.
Copyright (C) 1987, 1988, 1992, 1994, 1995, 1997, 1998, 1999, 2000, 2004,
- 2005, 2006, 2007
+ 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
/* Several operations to be done in parallel (perhaps under COND_EXEC). */
DEF_RTL_EXPR(PARALLEL, "parallel", "E", RTX_EXTRA)
-#ifdef USE_MAPPED_LOCATION
/* A string that is passed through to the assembler as input.
One can obviously pass comments through by using the
assembler comment syntax.
and whose mode indicates the mode of the input operand.
6th is the source line number. */
DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands", "ssiEEi", RTX_EXTRA)
-#else
-/* A string that is passed through to the assembler as input.
- One can obviously pass comments through by using the
- assembler comment syntax.
- These occur in an insn all by themselves as the PATTERN.
- They also appear inside an ASM_OPERANDS
- as a convenient way to hold a string. */
-DEF_RTL_EXPR(ASM_INPUT, "asm_input", "ssi", RTX_EXTRA)
-
-/* An assembler instruction with operands.
- 1st operand is the instruction template.
- 2nd operand is the constraint for the output.
- 3rd operand is the number of the output this expression refers to.
- When an insn stores more than one value, a separate ASM_OPERANDS
- is made for each output; this integer distinguishes them.
- 4th is a vector of values of input operands.
- 5th is a vector of modes and constraints for the input operands.
- Each element is an ASM_INPUT containing a constraint string
- and whose mode indicates the mode of the input operand.
- 6th is the name of the containing source file.
- 7th is the source line number. */
-DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands", "ssiEEsi", RTX_EXTRA)
-#endif
/* A machine-specific operation.
1st operand is a vector of operands being used by the operation so that
/* Register Transfer Language (RTL) definitions for GCC
Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
XSTR (XCVECEXP (RTX, 4, N, ASM_OPERANDS), 0)
#define ASM_OPERANDS_INPUT_MODE(RTX, N) \
GET_MODE (XCVECEXP (RTX, 4, N, ASM_OPERANDS))
-#ifdef USE_MAPPED_LOCATION
#define ASM_OPERANDS_SOURCE_LOCATION(RTX) XCUINT (RTX, 5, ASM_OPERANDS)
#define ASM_INPUT_SOURCE_LOCATION(RTX) XCUINT (RTX, 1, ASM_INPUT)
-#else
-#define ASM_OPERANDS_SOURCE_FILE(RTX) XCSTR (RTX, 5, ASM_OPERANDS)
-#define ASM_OPERANDS_SOURCE_LINE(RTX) XCINT (RTX, 6, ASM_OPERANDS)
-#define ASM_INPUT_SOURCE_FILE(RTX) XCSTR (RTX, 1, ASM_INPUT)
-#define ASM_INPUT_SOURCE_LINE(RTX) XCINT (RTX, 2, ASM_INPUT)
-#endif
/* 1 if RTX is a mem that is statically allocated in read-only memory. */
#define MEM_READONLY_P(RTX) \
#ifndef GENERATOR_FILE
#include "genrtl.h"
#undef gen_rtx_ASM_INPUT
-#ifdef USE_MAPPED_LOCATION
#define gen_rtx_ASM_INPUT(MODE, ARG0) \
gen_rtx_fmt_si (ASM_INPUT, (MODE), (ARG0), 0)
#define gen_rtx_ASM_INPUT_loc(MODE, ARG0, LOC) \
gen_rtx_fmt_si (ASM_INPUT, (MODE), (ARG0), (LOC))
-#else
-#define gen_rtx_ASM_INPUT(MODE, ARG0) \
- gen_rtx_fmt_ssi (ASM_INPUT, (MODE), (ARG0), "", 0)
-#define gen_rtx_ASM_INPUT_loc(MODE, ARG0, LOC) \
- gen_rtx_fmt_ssi (ASM_INPUT, (MODE), (ARG0), (LOC).file, (LOC).line)
-#undef gen_rtx_ASM_OPERANDS
-#define gen_rtx_ASM_OPERANDS(MODE, ARG0, ARG1, ARG2, ARG3, ARG4, LOC) \
- gen_rtx_fmt_ssiEEsi (ASM_OPERANDS, (MODE), (ARG0), (ARG1), (ARG2), (ARG3), (ARG4), (LOC).file, (LOC).line)
-#endif
#endif
/* There are some RTL codes that require special attention; the
/* Get common system includes and various definitions and declarations based
on autoconf macros.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
LANG_HOOKS_MAYBE_BUILD_CLEANUP LANG_HOOKS_UPDATE_DECL_AFTER_SAVING \
LANG_HOOKS_POPLEVEL LANG_HOOKS_TRUTHVALUE_CONVERSION
+/* Miscellaneous macros that are no longer used. */
+ #pragma GCC poison USE_MAPPED_LOCATION
+
/* Libiberty macros that are no longer used in GCC. */
#undef ANSI_PROTOTYPES
#undef PTR_CONST
/* Top level of GCC compilers (cc1, cc1plus, etc.)
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
const char *main_input_filename;
-#ifndef USE_MAPPED_LOCATION
-location_t unknown_location = { NULL, 0 };
-#endif
-
/* Used to enable -fvar-tracking, -fweb and -frename-registers according
to optimize and default_debug_hooks in process_options (). */
#define AUTODETECT_VALUE 2
INPUT_LOCATION accordingly. */
void
-#ifdef USE_MAPPED_LOCATION
push_srcloc (location_t fline)
-#else
-push_srcloc (const char *file, int line)
-#endif
{
struct file_stack *fs;
fs = XNEW (struct file_stack);
fs->location = input_location;
fs->next = input_file_stack;
-#ifdef USE_MAPPED_LOCATION
input_location = fline;
-#else
- input_filename = file;
- input_line = line;
-#endif
input_file_stack = fs;
input_file_stack_tick++;
VEC_safe_push (fs_p, heap, input_file_stack_history, input_file_stack);
sets the original filename if appropriate (e.g. foo.i -> foo.c)
so we can correctly initialize debug output. */
no_backend = lang_hooks.post_options (&main_input_filename);
-#ifndef USE_MAPPED_LOCATION
- input_filename = main_input_filename;
-#endif
#ifdef OVERRIDE_OPTIONS
/* Some machines may reject certain combinations of options. */
dump_base_name = name && name[0] ? name : "gccdump";
/* Other front-end initialization. */
-#ifdef USE_MAPPED_LOCATION
input_location = BUILTINS_LOCATION;
-#else
- input_filename = "<built-in>";
- input_line = 0;
-#endif
if (lang_hooks.init () == 0)
return 0;
input_location = save_loc;
else_bb = label_to_block (else_label);
e = make_edge (bb, then_bb, EDGE_TRUE_VALUE);
-#ifdef USE_MAPPED_LOCATION
e->goto_locus = EXPR_LOCATION (COND_EXPR_THEN (entry));
-#else
- e->goto_locus = EXPR_LOCUS (COND_EXPR_THEN (entry));
-#endif
e = make_edge (bb, else_bb, EDGE_FALSE_VALUE);
if (e)
- {
-#ifdef USE_MAPPED_LOCATION
- e->goto_locus = EXPR_LOCATION (COND_EXPR_ELSE (entry));
-#else
- e->goto_locus = EXPR_LOCUS (COND_EXPR_ELSE (entry));
-#endif
- }
+ e->goto_locus = EXPR_LOCATION (COND_EXPR_ELSE (entry));
/* We do not need the gotos anymore. */
COND_EXPR_THEN (entry) = NULL_TREE;
{
tree dest = GOTO_DESTINATION (goto_t);
edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
-#ifdef USE_MAPPED_LOCATION
e->goto_locus = EXPR_LOCATION (goto_t);
-#else
- e->goto_locus = EXPR_LOCUS (goto_t);
-#endif
bsi_remove (&last, true);
return;
}
remove_bb (basic_block bb)
{
block_stmt_iterator i;
-#ifdef USE_MAPPED_LOCATION
source_location loc = UNKNOWN_LOCATION;
-#else
- source_locus loc = 0;
-#endif
if (dump_file)
{
program that are indeed unreachable. */
if (TREE_CODE (stmt) != GOTO_EXPR && EXPR_HAS_LOCATION (stmt) && !loc)
{
-#ifdef USE_MAPPED_LOCATION
if (EXPR_HAS_LOCATION (stmt))
loc = EXPR_LOCATION (stmt);
-#else
- source_locus t;
- t = EXPR_LOCUS (stmt);
- if (t && LOCATION_LINE (*t) > 0)
- loc = t;
-#endif
}
}
}
block is unreachable. We walk statements backwards in the
loop above, so the last statement we process is the first statement
in the block. */
-#ifdef USE_MAPPED_LOCATION
if (loc > BUILTINS_LOCATION && LOCATION_LINE (loc) > 0)
warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
-#else
- if (loc)
- warning (OPT_Wunreachable_code, "%Hwill never be executed", loc);
-#endif
remove_phi_nodes_and_edges_for_unreachable_block (bb);
bb->il.tree = NULL;
static unsigned int
execute_warn_function_return (void)
{
-#ifdef USE_MAPPED_LOCATION
source_location location;
-#else
- location_t *locus;
-#endif
tree last;
edge e;
edge_iterator ei;
if (TREE_THIS_VOLATILE (cfun->decl)
&& EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0)
{
-#ifdef USE_MAPPED_LOCATION
location = UNKNOWN_LOCATION;
-#else
- locus = NULL;
-#endif
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
{
last = last_stmt (e->src);
if (TREE_CODE (last) == RETURN_EXPR
-#ifdef USE_MAPPED_LOCATION
&& (location = EXPR_LOCATION (last)) != UNKNOWN_LOCATION)
-#else
- && (locus = EXPR_LOCUS (last)) != NULL)
-#endif
break;
}
-#ifdef USE_MAPPED_LOCATION
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
warning (0, "%H%<noreturn%> function does return", &location);
-#else
- if (!locus)
- locus = &cfun->function_end_locus;
- warning (0, "%H%<noreturn%> function does return", locus);
-#endif
}
/* If we see "return;" in some basic block, then we do reach the end
&& TREE_OPERAND (last, 0) == NULL
&& !TREE_NO_WARNING (last))
{
-#ifdef USE_MAPPED_LOCATION
location = EXPR_LOCATION (last);
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
warning (OPT_Wreturn_type, "%Hcontrol reaches end of non-void function", &location);
-#else
- locus = EXPR_LOCUS (last);
- if (!locus)
- locus = &cfun->function_end_locus;
- warning (OPT_Wreturn_type, "%Hcontrol reaches end of non-void function", locus);
-#endif
TREE_NO_WARNING (cfun->decl) = 1;
break;
}
/* Mudflap: narrow-pointer bounds-checking by tree rewriting.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Frank Ch. Eigler <fche@redhat.com>
and Graydon Hoare <graydon@redhat.com>
const char *sourcefile;
unsigned sourceline = xloc.line;
unsigned sourcecolumn = 0;
-#ifdef USE_MAPPED_LOCATION
sourcecolumn = xloc.column;
-#endif
sourcefile = xloc.file;
if (sourcefile == NULL && current_function_decl != NULL_TREE)
sourcefile = DECL_SOURCE_FILE (current_function_decl);
if (xloc.line > 0)
{
-#ifdef USE_MAPPED_LOCATION
if (xloc.column > 0)
sprintf (linecolbuf, "%d:%d", xloc.line, xloc.column);
else
-#endif
sprintf (linecolbuf, "%d", xloc.line);
colon = ":";
line = linecolbuf;
/* Pretty formatting of GENERIC trees in C syntax.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Adapted from c-pretty-print.c by Diego Novillo <dnovillo@redhat.com>
{
INDENT (indent);
- if ((flags & TDF_LINENO)
-#ifdef USE_MAPPED_LOCATION
- && e->goto_locus != UNKNOWN_LOCATION
-#else
- && e->goto_locus
-#endif
- )
+ if ((flags & TDF_LINENO) && e->goto_locus != UNKNOWN_LOCATION)
{
expanded_location goto_xloc;
-#ifdef USE_MAPPED_LOCATION
goto_xloc = expand_location (e->goto_locus);
-#else
- goto_xloc = *e->goto_locus;
-#endif
pp_character (buffer, '[');
if (goto_xloc.file)
{
/* Transformation Utilities for Loop Vectorization.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Dorit Naishlos <dorit@il.ibm.com>
This file is part of GCC.
/* Make sure bsi points to the stmt that is being vectorized. */
gcc_assert (stmt == bsi_stmt (*bsi));
-#ifdef USE_MAPPED_LOCATION
SET_EXPR_LOCATION (vec_stmt, EXPR_LOCATION (stmt));
-#else
- SET_EXPR_LOCUS (vec_stmt, EXPR_LOCUS (stmt));
-#endif
}
/* Loop Vectorization
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Dorit Naishlos <dorit@il.ibm.com>
This file is part of GCC.
#ifndef GCC_TREE_VECTORIZER_H
#define GCC_TREE_VECTORIZER_H
-#ifdef USE_MAPPED_LOCATION
- typedef source_location LOC;
- #define UNKNOWN_LOC UNKNOWN_LOCATION
- #define EXPR_LOC(e) EXPR_LOCATION(e)
- #define LOC_FILE(l) LOCATION_FILE (l)
- #define LOC_LINE(l) LOCATION_LINE (l)
-#else
- typedef source_locus LOC;
- #define UNKNOWN_LOC NULL
- #define EXPR_LOC(e) EXPR_LOCUS(e)
- #define LOC_FILE(l) (l)->file
- #define LOC_LINE(l) (l)->line
-#endif
+typedef source_location LOC;
+#define UNKNOWN_LOC UNKNOWN_LOCATION
+#define EXPR_LOC(e) EXPR_LOCATION(e)
+#define LOC_FILE(l) LOCATION_FILE (l)
+#define LOC_LINE(l) LOCATION_LINE (l)
/* Used for naming of new temporaries. */
enum vect_var_kind {
/* Language-independent node constructors for parse phase of GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
TREE_SET_CODE (t, code);
TREE_TYPE (t) = type;
-#ifdef USE_MAPPED_LOCATION
SET_EXPR_LOCATION (t, UNKNOWN_LOCATION);
-#else
- SET_EXPR_LOCUS (t, NULL);
-#endif
TREE_OPERAND (t, 0) = node;
TREE_BLOCK (t) = NULL_TREE;
if (node && !TYPE_P (node))
return block;
}
-#if 1 /* ! defined(USE_MAPPED_LOCATION) */
-/* ??? gengtype doesn't handle conditionals */
-static GTY(()) source_locus last_annotated_node;
-#endif
-
-#ifdef USE_MAPPED_LOCATION
-
expanded_location
expand_location (source_location loc)
{
return xloc;
}
-#else
-
-/* Record the exact location where an expression or an identifier were
- encountered. */
-
-void
-annotate_with_file_line (tree node, const char *file, int line)
-{
- location_t *new_loc;
-
- /* Roughly one percent of the calls to this function are to annotate
- a node with the same information already attached to that node!
- Just return instead of wasting memory. */
- if (EXPR_LOCUS (node)
- && EXPR_LINENO (node) == line
- && (EXPR_FILENAME (node) == file
- || !strcmp (EXPR_FILENAME (node), file)))
- {
- last_annotated_node = EXPR_LOCUS (node);
- return;
- }
-
- /* In heavily macroized code (such as GCC itself) this single
- entry cache can reduce the number of allocations by more
- than half. */
- if (last_annotated_node
- && last_annotated_node->line == line
- && (last_annotated_node->file == file
- || !strcmp (last_annotated_node->file, file)))
- {
- SET_EXPR_LOCUS (node, last_annotated_node);
- return;
- }
-
- new_loc = GGC_NEW (location_t);
- new_loc->file = file;
- new_loc->line = line;
- SET_EXPR_LOCUS (node, new_loc);
- last_annotated_node = new_loc;
-}
-
-void
-annotate_with_locus (tree node, location_t locus)
-{
- annotate_with_file_line (node, locus.file, locus.line);
-}
-#endif
\f
/* Source location accessor functions. */
location_t
expr_location (const_tree node)
{
-#ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node))
return GIMPLE_STMT_LOCUS (node);
return EXPR_P (node) ? node->exp.locus : UNKNOWN_LOCATION;
-#else
- if (GIMPLE_STMT_P (node))
- return EXPR_HAS_LOCATION (node)
- ? *GIMPLE_STMT_LOCUS (node) : UNKNOWN_LOCATION;
- return EXPR_HAS_LOCATION (node) ? *node->exp.locus : UNKNOWN_LOCATION;
-#endif
}
void
set_expr_location (tree node, location_t locus)
{
-#ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node))
GIMPLE_STMT_LOCUS (node) = locus;
else
EXPR_CHECK (node)->exp.locus = locus;
-#else
- annotate_with_locus (node, locus);
-#endif
}
bool
expr_has_location (const_tree node)
{
-#ifdef USE_MAPPED_LOCATION
return expr_location (node) != UNKNOWN_LOCATION;
-#else
- return expr_locus (node) != NULL;
-#endif
}
-#ifdef USE_MAPPED_LOCATION
source_location *
-#else
-source_locus
-#endif
expr_locus (const_tree node)
{
-#ifdef USE_MAPPED_LOCATION
if (GIMPLE_STMT_P (node))
return CONST_CAST (source_location *, &GIMPLE_STMT_LOCUS (node));
return (EXPR_P (node)
? CONST_CAST (source_location *, &node->exp.locus)
: (source_location *) NULL);
-#else
- if (GIMPLE_STMT_P (node))
- return GIMPLE_STMT_LOCUS (node);
- return EXPR_P (node) ? node->exp.locus : (source_locus) NULL;
-#endif
}
void
-set_expr_locus (tree node,
-#ifdef USE_MAPPED_LOCATION
- source_location *loc
-#else
- source_locus loc
-#endif
- )
+set_expr_locus (tree node, source_location *loc)
{
-#ifdef USE_MAPPED_LOCATION
if (loc == NULL)
{
if (GIMPLE_STMT_P (node))
else
EXPR_CHECK (node)->exp.locus = *loc;
}
-#else
- if (GIMPLE_STMT_P (node))
- GIMPLE_STMT_LOCUS (node) = loc;
- else
- EXPR_CHECK (node)->exp.locus = loc;
-#endif
}
/* Return the file name of the location of NODE. */
expr_filename (const_tree node)
{
if (GIMPLE_STMT_P (node))
- return LOCATION_FILE (location_from_locus (GIMPLE_STMT_LOCUS (node)));
- return LOCATION_FILE (location_from_locus (EXPR_CHECK (node)->exp.locus));
+ return LOCATION_FILE (GIMPLE_STMT_LOCUS (node));
+ return LOCATION_FILE (EXPR_CHECK (node)->exp.locus);
}
/* Return the line number of the location of NODE. */
expr_lineno (const_tree node)
{
if (GIMPLE_STMT_P (node))
- return LOCATION_LINE (location_from_locus (GIMPLE_STMT_LOCUS (node)));
- return LOCATION_LINE (location_from_locus (EXPR_CHECK (node)->exp.locus));
+ return LOCATION_LINE (GIMPLE_STMT_LOCUS (node));
+ return LOCATION_LINE (EXPR_CHECK (node)->exp.locus);
}
\f
struct gimple_stmt GTY(())
{
struct tree_base base;
- source_locus locus;
+ location_t locus;
tree block;
/* FIXME tuples: Eventually this should be of type ``struct gimple_expr''. */
tree GTY ((length ("TREE_CODE_LENGTH (TREE_CODE (&%h))"))) operands[1];
struct tree_exp GTY(())
{
struct tree_common common;
- source_locus locus;
+ location_t locus;
tree block;
tree GTY ((special ("tree_exp"),
desc ("TREE_CODE ((tree) &%0)")))
#define DECL_SOURCE_LOCATION(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
#define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
#define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
-#ifdef USE_MAPPED_LOCATION
#define DECL_IS_BUILTIN(DECL) \
(DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
-#else
-#define DECL_IS_BUILTIN(DECL) (DECL_SOURCE_LINE(DECL) == 0)
-#endif
/* For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL,
extern tree build_fn_decl (const char *, tree);
#define build_decl(c,t,q) build_decl_stat (c,t,q MEM_STAT_INFO)
extern tree build_block (tree, tree, tree, tree);
-#ifndef USE_MAPPED_LOCATION
-extern void annotate_with_file_line (tree, const char *, int);
-extern void annotate_with_locus (tree, location_t);
-#endif
extern tree build_empty_stmt (void);
extern tree build_omp_clause (enum omp_clause_code);
extern void set_expr_location (tree, location_t);
extern bool expr_has_location (const_tree);
-#ifdef USE_MAPPED_LOCATION
-extern source_locus *expr_locus (const_tree);
+extern location_t *expr_locus (const_tree);
extern void set_expr_locus (tree, source_location *);
-#else
-extern source_locus expr_locus (const_tree);
-extern void set_expr_locus (tree, source_locus loc);
-#endif
extern const char *expr_filename (const_tree);
extern int expr_lineno (const_tree);
+2008-02-26 Tom Tromey <tromey@redhat.com>
+
+ * tree1.c (treelang_init): Remove old location code.
+ (treelang_parse_file): Likewise.
+ * lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove.
+ (update_lineno_charno): Remove old location code.
+
2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR other/35107
---------------------------------------------------------------------
Copyright (C) 1986, 87, 89, 92-96, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
{fprintf (stderr, "\nlexer returning"); dump_lex_value (a);} return a;}
#define NOT_RETURN(a) {update_yylval (a); if (option_lexer_trace)\
{fprintf (stderr, "\nlexer swallowing"); dump_lex_value (a);}}
-#ifndef USE_MAPPED_LOCATION
-#undef LINEMAP_POSITION_FOR_COLUMN
-#define LINEMAP_POSITION_FOR_COLUMN(INPUT, LINETABLE, COL)
-#endif
%}
%option nostack
{
if ( yytext[yyl] == '\n' )
{
-#ifdef USE_MAPPED_LOCATION
source_location s = linemap_line_start (line_table, ++lineno,
80);
input_location = s;
-#else
- input_line = ++lineno;
-#endif
next_tree_charno = 1;
}
else
Called by GCC's toplev.c
Copyright (C) 1986, 87, 89, 92-96, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
bool
treelang_init (void)
{
-#ifndef USE_MAPPED_LOCATION
- input_filename = main_input_filename;
-#else
linemap_add (line_table, LC_ENTER, false, main_input_filename, 1);
-#endif
/* This error will not happen from GCC as it will always create a
fake input file. */
exit (1);
}
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_RENAME, false, "<built-in>", 1);
linemap_line_start (line_table, 0, 1);
-#endif
/* Init decls, etc. */
treelang_init_decl_processing ();
void
treelang_parse_file (int debug_flag ATTRIBUTE_UNUSED)
{
-#ifdef USE_MAPPED_LOCATION
source_location s;
linemap_add (line_table, LC_RENAME, false, main_input_filename, 1);
s = linemap_line_start (line_table, 1, 80);
input_location = s;
-#else
- input_line = 1;
-#endif
treelang_debug ();
yyparse ();
cgraph_finalize_compilation_unit ();
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, false, NULL, 0);
-#endif
cgraph_optimize ();
}