From: Tom Tromey Date: Tue, 26 Feb 2008 16:05:24 +0000 (+0000) Subject: system.h (USE_MAPPED_LOCATION): Poison. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d593c86cfae119d9b8e765a07a952eda35ca5af;p=gcc.git system.h (USE_MAPPED_LOCATION): Poison. gcc * 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) : 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) : Now a location_t. (tree_exp) : 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. gcc/ada * 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. gcc/cp * 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. gcc/fortran * 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. gcc/java * 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. gcc/objc * objc-act.c (objc_init): Remove old location code. gcc/treelang * 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. From-SVN: r132679 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f9aa8df1a0..35ee86e328b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,87 @@ +2008-02-26 Tom Tromey + + * 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) : 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) : Now a location_t. + (tree_exp) : 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 PR 26264 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 486a8111991..34ad39509cc 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3087,8 +3087,8 @@ s-constrs-h: $(MD_DEPS) build/genpreds$(build_exeext) $(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) \ diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 954f1a90c5a..148d066b42b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2008-02-26 Tom Tromey + + * 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 * gnat_rm.texi, gnat_ugn.texi: Fix spacing after `e.g.' and diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index c54bd9f7b90..4ddf10f23a9 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -412,11 +412,9 @@ internal_error_function (const char *msgid, va_list *ap) 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); diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index d1b454ca4d8..34cb297d245 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -244,7 +244,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, 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 @@ -268,7 +267,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, linemap_position_for_column (line_table, 252 - 1); linemap_add (line_table, LC_LEAVE, 0, NULL, 0); } -#endif /* Initialize ourselves. */ init_code_table (); @@ -6650,7 +6648,6 @@ Sloc_to_locus (Source_Ptr Sloc, location_t *locus) return false; if (Sloc <= Standard_Location) -#ifdef USE_MAPPED_LOCATION { *locus = BUILTINS_LOCATION; return false; @@ -6667,22 +6664,6 @@ Sloc_to_locus (Source_Ptr Sloc, location_t *locus) + ((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 diff --git a/gcc/basic-block.h b/gcc/basic-block.h index c04c6f6ee53..0261ef363be 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -1,6 +1,6 @@ /* 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. @@ -130,7 +130,7 @@ struct edge_def GTY(()) 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. */ diff --git a/gcc/c-common.c b/gcc/c-common.c index 2b8790d0729..9706d874456 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -840,11 +840,7 @@ fname_decl (unsigned int rid, tree id) 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); diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 4e9564d25e1..7a600409cbb 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2760,12 +2760,7 @@ c_init_decl_processing (void) /* 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 = ""; - input_location.line = 0; -#endif build_common_tree_nodes (flag_signed_char, false); @@ -6721,7 +6716,6 @@ finish_function (void) 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 @@ -6729,12 +6723,6 @@ finish_function (void) 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 } } } diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 5cad2609a4a..7bc283b1300 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1,6 +1,6 @@ /* 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. @@ -190,15 +190,7 @@ cb_line_change (cpp_reader * ARG_UNUSED (pfile), const cpp_token *token, 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 @@ -213,17 +205,10 @@ fe_file_change (const struct line_map *new_map) 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) @@ -253,12 +238,7 @@ fe_file_change (const struct line_map *new_map) 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 @@ -271,14 +251,7 @@ cb_def_pragma (cpp_reader *pfile, source_location loc) { 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); @@ -329,12 +302,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, 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: @@ -381,19 +349,11 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, /* 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) { @@ -417,9 +377,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, default: /* ... or not. */ error ("%Hstray %<@%> in program", &atloc); -#ifdef USE_MAPPED_LOCATION *loc = newloc; -#endif goto retry_after_at; } break; diff --git a/gcc/c-pch.c b/gcc/c-pch.c index ccf3c86590c..691e12a2f79 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -1,5 +1,5 @@ /* 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. @@ -410,16 +410,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, } /* 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); diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index d22facbabe3..943a0704168 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1,5 +1,5 @@ /* 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. @@ -1316,7 +1316,7 @@ expand_gimple_cond_expr (basic_block bb, tree stmt) 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; } @@ -1326,7 +1326,7 @@ expand_gimple_cond_expr (basic_block bb, tree stmt) 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; } @@ -1357,7 +1357,7 @@ expand_gimple_cond_expr (basic_block bb, tree stmt) 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; } @@ -1624,7 +1624,7 @@ expand_gimple_basic_block (basic_block 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; } @@ -1724,11 +1724,7 @@ construct_exit_block (void) /* 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. */ diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index c70348c9a4d..5387b388260 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -1,5 +1,5 @@ /* 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. @@ -255,13 +255,8 @@ insn_locators_alloc (void) 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; @@ -284,15 +279,8 @@ set_curr_insn_source_location (location_t location) 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; } @@ -321,12 +309,7 @@ curr_insn_locator (void) 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); diff --git a/gcc/config.in b/gcc/config.in index 723b88fc8e7..37fbe453e5d 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1448,12 +1448,6 @@ #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}. diff --git a/gcc/configure b/gcc/configure index 0347f38a9aa..ea8549a1226 100755 --- a/gcc/configure +++ b/gcc/configure @@ -869,7 +869,6 @@ Optional Features: 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 @@ -6895,22 +6894,6 @@ fi -# 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 diff --git a/gcc/configure.ac b/gcc/configure.ac index bb7c0566046..118d9b2a77b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -523,15 +523,6 @@ fi 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] diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7ab99249c57..f56c61c7310 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,19 @@ +2008-02-26 Tom Tromey + + * 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 PR 26264 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 85186c97c24..5a5a81a4d01 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -357,12 +357,7 @@ pop_label (tree label, tree old_value) 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)); } @@ -11807,14 +11802,10 @@ finish_function (int flags) /* 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)) diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 695390ce78f..d7e3d766ca7 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1,6 +1,6 @@ /* 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. @@ -2995,11 +2995,8 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, 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. */ @@ -3179,13 +3176,7 @@ cp_write_global_declarations (void) 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: @@ -3318,11 +3309,7 @@ cp_write_global_declarations (void) 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 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 94e43c05f9c..0893f801565 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2436,14 +2436,12 @@ cp_print_error_function (diagnostic_context *context, 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), diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 136260bef49..2558a78dbf7 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -1,6 +1,6 @@ /* 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) @@ -385,14 +385,7 @@ cxx_init (void) 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 ("", 0); -#endif init_reswords (); init_tree (); @@ -572,17 +565,9 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED ) 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) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index cb0059392a7..77542bfb9f1 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -100,11 +100,7 @@ DEF_VEC_ALLOC_P (cp_token_position,heap); 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 @@ -7206,10 +7202,7 @@ check_empty_body (cp_parser* parser, const char* type) 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", diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2a54986c551..ade17a5cedd 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9156,13 +9156,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) 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"); diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 6bbfe9a36e7..05f153387d7 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -1,5 +1,5 @@ /* 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 @@ -157,10 +157,8 @@ diagnostic_build_prefix (diagnostic_info *diagnostic) 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)); } diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 1a9239ab8a5..36997cd77a6 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1,6 +1,6 @@ /* 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. @@ -4533,11 +4533,7 @@ emit_note (enum insn_note kind) 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 diff --git a/gcc/final.c b/gcc/final.c index 8d1cebead41..05d60d5d68d 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1,6 +1,6 @@ /* 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. @@ -2192,12 +2192,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, 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); diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5ba83fb7b87..aef1c7934f7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,21 @@ +2008-02-26 Tom Tromey + + * 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 PR fortran/34729 diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c index 1fe2ee51f9d..13af445dfd4 100644 --- a/gcc/fortran/data.c +++ b/gcc/fortran/data.c @@ -424,14 +424,9 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index) /* 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); } diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c index 0718e5af5b5..669c2d47a6b 100644 --- a/gcc/fortran/error.c +++ b/gcc/fortran/error.c @@ -182,11 +182,7 @@ show_locus (locus *loc, int c1, int c2) 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 ('.'); diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index ea795b24f74..643f41865e4 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -276,10 +276,8 @@ gfc_be_parse_file (int set_yydebug ATTRIBUTE_UNUSED) 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, "", 0); -#endif /* First initialize the backend. */ gfc_init_decl_processing (); diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5aef5bf1158..cc749792604 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -713,11 +713,7 @@ typedef struct gfc_file typedef struct gfc_linebuf { -#ifdef USE_MAPPED_LOCATION source_location location; -#else - int linenum; -#endif struct gfc_file *file; struct gfc_linebuf *next; @@ -729,11 +725,7 @@ typedef struct gfc_linebuf #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 { diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index ad3b5158334..b93e1c65478 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -1064,11 +1064,7 @@ gfc_gobble_whitespace (void) 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; @@ -1285,9 +1281,7 @@ get_file (const char *name, enum lc_reason reason ATTRIBUTE_UNUSED) 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; } @@ -1412,10 +1406,8 @@ preprocessor_line (char *c) 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 @@ -1645,12 +1637,8 @@ load_file (const char *filename, bool initial) 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); @@ -1674,9 +1662,7 @@ load_file (const char *filename, bool initial) 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; } @@ -1699,13 +1685,8 @@ gfc_new_file (void) #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); diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 52393b46bf2..70609aca135 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -224,12 +224,7 @@ gfc_get_return_label (void) 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 } diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index d0af3429db4..f5f1df0c7c2 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -851,11 +851,7 @@ set_error_locus (stmtblock_t * block, tree var, locus * where) 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); } diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 11ef0bf540c..36a7f122c0b 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -382,11 +382,7 @@ gfc_trans_runtime_check (tree cond, stmtblock_t * pblock, locus * where, 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); } @@ -940,11 +936,7 @@ void 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; } @@ -955,12 +947,7 @@ void 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 } diff --git a/gcc/gengtype.c b/gcc/gengtype.c index ca7d5b411cd..e136a13d744 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -1,5 +1,5 @@ /* 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. @@ -521,16 +521,11 @@ do_typedef (const char *s, type_p t, struct fileloc *pos) { 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) @@ -3478,36 +3473,6 @@ note_def_vec_alloc (const char *type, const char *astrat, struct fileloc *pos) 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 -} - int main (int argc, char **argv) @@ -3544,7 +3509,6 @@ 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]); diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 302efb55b32..a860dd1caf1 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -1,6 +1,6 @@ /* 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. @@ -108,11 +108,7 @@ lower_function_body (void) 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); } diff --git a/gcc/input.h b/gcc/input.h index c360a1d5312..4a3040c3d50 100644 --- a/gcc/input.h +++ b/gcc/input.h @@ -1,6 +1,6 @@ /* 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. @@ -23,17 +23,16 @@ along with GCC; see the file COPYING3. If not see #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 "" */ #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; @@ -46,34 +45,9 @@ typedef struct 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 { @@ -85,19 +59,15 @@ 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. */ diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 73a77947a80..90f9a0cad9e 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,16 @@ +2008-02-26 Tom Tromey + + * 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 PR other/35107 diff --git a/gcc/java/class.c b/gcc/java/class.c index 2aec3a5addf..4eb3360a539 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1,6 +1,6 @@ /* 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. @@ -479,10 +479,6 @@ push_class (tree class_type, tree class_name) { tree decl, signature; location_t saved_loc = input_location; -#ifndef USE_MAPPED_LOCATION - input_filename = ""; - input_line = 0; -#endif CLASS_P (class_type) = 1; decl = build_decl (TYPE_DECL, class_name, class_type); TYPE_DECL_SUPPRESS_DEBUG (decl) = 1; diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 1f0dbf46de6..9f08746154a 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1,7 +1,7 @@ /* 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. @@ -1851,12 +1851,7 @@ finish_method (tree fndecl) 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); diff --git a/gcc/java/expr.c b/gcc/java/expr.c index a482a969235..c174ed9a41e 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -1,6 +1,6 @@ /* 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. @@ -3218,11 +3218,7 @@ expand_byte_code (JCF *jcf, tree method) 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; } diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index c3fe5247891..3350191dc34 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -1,6 +1,6 @@ /* 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. @@ -327,14 +327,7 @@ set_source_filename (JCF *jcf, int index) && 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) { @@ -364,13 +357,7 @@ set_source_filename (JCF *jcf, int index) } 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; } @@ -1205,7 +1192,6 @@ give_name_to_class (JCF *jcf, int i) 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); @@ -1216,14 +1202,6 @@ give_name_to_class (JCF *jcf, int i) 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; @@ -1496,9 +1474,7 @@ jcf_parse (JCF* jcf) 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) @@ -1531,13 +1507,8 @@ static void 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); } @@ -1586,13 +1557,11 @@ parse_class_file (void) 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); @@ -1657,13 +1626,8 @@ parse_class_file (void) 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 { @@ -1934,18 +1898,14 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) 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) @@ -1962,9 +1922,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) 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 } } diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 4dc1f19eda4..76b024ce822 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -1,6 +1,6 @@ /* 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. @@ -655,10 +655,8 @@ java_post_options (const char **pfilename) } } } -#ifdef USE_MAPPED_LOCATION linemap_add (line_table, LC_ENTER, false, filename, 0); linemap_add (line_table, LC_RENAME, false, "", 0); -#endif /* Initialize the compiler back end. */ return false; diff --git a/gcc/langhooks.c b/gcc/langhooks.c index c565daa2d97..2df5c27915d 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -1,5 +1,5 @@ /* 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 @@ -455,14 +455,12 @@ lhd_print_error_function (diagnostic_context *context, const char *file, 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), diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 3760dcc922d..6a1fc5671b4 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,7 @@ +2008-02-26 Tom Tromey + + * objc-act.c (objc_init): Remove old location code. + 2008-02-06 Kaveh R. Ghazi PR other/35107 diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 3d5a83b044e..c8b418ce328 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -1,6 +1,6 @@ /* 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. @@ -484,13 +484,6 @@ objc_init (void) #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) { diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 8f2ca7555c8..7df81616d51 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -1,6 +1,6 @@ /* 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. @@ -442,10 +442,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent) 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)) { @@ -949,10 +947,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent) { 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, ">"); diff --git a/gcc/profile.c b/gcc/profile.c index 51747cf4314..a4f46b3ad4d 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -1,6 +1,6 @@ /* 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. @@ -814,15 +814,10 @@ branch_prob (void) 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; @@ -1020,16 +1015,10 @@ branch_prob (void) 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) diff --git a/gcc/recog.c b/gcc/recog.c index 6a9ae4510c0..2629adc3229 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1,6 +1,6 @@ /* 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. @@ -1490,14 +1490,7 @@ decode_asm_operands (rtx body, rtx *operands, rtx **operand_locs, } 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); } diff --git a/gcc/rtl-error.c b/gcc/rtl-error.c index c1166fdb84b..6f38631b71e 100644 --- a/gcc/rtl-error.c +++ b/gcc/rtl-error.c @@ -1,5 +1,5 @@ /* 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 This file is part of GCC. @@ -58,14 +58,7 @@ location_for_asm (const_rtx insn) 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; diff --git a/gcc/rtl.def b/gcc/rtl.def index fa2238c58b7..33bf6bd1879 100644 --- a/gcc/rtl.def +++ b/gcc/rtl.def @@ -2,7 +2,7 @@ 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. @@ -159,7 +159,6 @@ DEF_RTL_EXPR(COND_EXEC, "cond_exec", "ee", RTX_EXTRA) /* 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. @@ -180,29 +179,6 @@ DEF_RTL_EXPR(ASM_INPUT, "asm_input", "si", RTX_EXTRA) 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 diff --git a/gcc/rtl.h b/gcc/rtl.h index f4aa35a387b..604d0967895 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1,6 +1,6 @@ /* 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. @@ -1114,15 +1114,8 @@ do { \ 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) \ @@ -1892,20 +1885,10 @@ extern GTY(()) rtx return_address_pointer_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 diff --git a/gcc/system.h b/gcc/system.h index 568bd751a4c..f1386323d5e 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -1,6 +1,6 @@ /* 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. @@ -744,6 +744,9 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; 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 diff --git a/gcc/toplev.c b/gcc/toplev.c index fddf13f3924..cf0ec2ad287 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1,6 +1,6 @@ /* 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. @@ -134,10 +134,6 @@ static const char **save_argv; 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 @@ -962,11 +958,7 @@ warn_deprecated_use (tree node) 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; @@ -977,12 +969,7 @@ push_srcloc (const char *file, int line) 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); @@ -1732,9 +1719,6 @@ process_options (void) 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. */ @@ -2125,12 +2109,7 @@ lang_dependent_init (const char *name) dump_base_name = name && name[0] ? name : "gccdump"; /* Other front-end initialization. */ -#ifdef USE_MAPPED_LOCATION input_location = BUILTINS_LOCATION; -#else - input_filename = ""; - input_line = 0; -#endif if (lang_hooks.init () == 0) return 0; input_location = save_loc; diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index ffb4983744e..6d848a0c2d8 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -628,20 +628,10 @@ make_cond_expr_edges (basic_block bb) 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; @@ -835,11 +825,7 @@ make_goto_expr_edges (basic_block bb) { 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; } @@ -1993,11 +1979,7 @@ static void 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) { @@ -2065,15 +2047,8 @@ remove_bb (basic_block bb) 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 } } } @@ -2082,13 +2057,8 @@ remove_bb (basic_block bb) 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; @@ -6990,11 +6960,7 @@ gimplify_build1 (block_stmt_iterator *bsi, enum tree_code code, tree type, 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; @@ -7003,31 +6969,17 @@ execute_warn_function_return (void) 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% function does return", &location); -#else - if (!locus) - locus = &cfun->function_end_locus; - warning (0, "%H% function does return", locus); -#endif } /* If we see "return;" in some basic block, then we do reach the end @@ -7044,17 +6996,10 @@ execute_warn_function_return (void) && 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; } diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c index 4b9c11830ba..190a3d3ce2d 100644 --- a/gcc/tree-mudflap.c +++ b/gcc/tree-mudflap.c @@ -1,5 +1,5 @@ /* 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 and Graydon Hoare @@ -121,9 +121,7 @@ mf_varname_tree (tree decl) 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); @@ -214,11 +212,9 @@ mf_file_function_line_tree (location_t location) 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; diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 3b60b258ae4..b64571dbae2 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -1,5 +1,5 @@ /* 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 @@ -3112,20 +3112,10 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent, { 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) { diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index 352939f03b2..883d7457077 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -1,5 +1,5 @@ /* 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 This file is part of GCC. @@ -2111,11 +2111,7 @@ vect_finish_stmt_generation (tree stmt, tree vec_stmt, /* 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 } diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 7716e8e876e..93aa7978dec 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1,5 +1,5 @@ /* 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 This file is part of GCC. @@ -21,19 +21,11 @@ along with GCC; see the file COPYING3. If not see #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 { diff --git a/gcc/tree.c b/gcc/tree.c index 97c90ecf968..9f41635a09b 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1,6 +1,6 @@ /* 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. @@ -3030,11 +3030,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL) 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)) @@ -3476,13 +3472,6 @@ build_block (tree vars, tree subblocks, tree supercontext, tree chain) 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) { @@ -3503,53 +3492,6 @@ 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 /* Source location accessor functions. */ @@ -3560,71 +3502,39 @@ annotate_with_locus (tree node, location_t locus) 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)) @@ -3639,12 +3549,6 @@ set_expr_locus (tree 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. */ @@ -3652,8 +3556,8 @@ const char * 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. */ @@ -3661,8 +3565,8 @@ int 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); } diff --git a/gcc/tree.h b/gcc/tree.h index 82723ea1bab..5f441a8811b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -417,7 +417,7 @@ struct tree_common GTY(()) 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]; @@ -1841,7 +1841,7 @@ enum omp_clause_default_kind 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)"))) @@ -2515,12 +2515,8 @@ struct function; #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, @@ -3999,10 +3995,6 @@ extern tree build_decl_stat (enum tree_code, tree, tree MEM_STAT_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); @@ -4935,13 +4927,8 @@ extern location_t expr_location (const_tree); 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); diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog index 51a7988d91a..5aef0c14a3f 100644 --- a/gcc/treelang/ChangeLog +++ b/gcc/treelang/ChangeLog @@ -1,3 +1,10 @@ +2008-02-26 Tom Tromey + + * 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 PR other/35107 diff --git a/gcc/treelang/lex.l b/gcc/treelang/lex.l index d0964c4af90..86a81d78343 100644 --- a/gcc/treelang/lex.l +++ b/gcc/treelang/lex.l @@ -5,7 +5,7 @@ --------------------------------------------------------------------- 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 @@ -59,10 +59,6 @@ static void dump_lex_value (int lexret); {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 @@ -242,13 +238,9 @@ update_lineno_charno (void) { 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 diff --git a/gcc/treelang/tree1.c b/gcc/treelang/tree1.c index a2f990f862d..e667a846eba 100644 --- a/gcc/treelang/tree1.c +++ b/gcc/treelang/tree1.c @@ -2,7 +2,7 @@ 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 @@ -139,11 +139,7 @@ treelang_handle_option (size_t scode, const char *arg ATTRIBUTE_UNUSED, 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. */ @@ -165,10 +161,8 @@ treelang_init (void) exit (1); } -#ifdef USE_MAPPED_LOCATION linemap_add (line_table, LC_RENAME, false, "", 1); linemap_line_start (line_table, 0, 1); -#endif /* Init decls, etc. */ treelang_init_decl_processing (); @@ -189,21 +183,15 @@ treelang_finish (void) 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 (); }