From c8cc8542fa03e78ff3a39734f5dad49b233be54f Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Tue, 7 Sep 2004 07:43:37 -0700 Subject: error.c (show_locus): Handle mapped locations. 2004-09-07 Per Bothner Paul Brook * error.c (show_locus): Handle mapped locations. * f95-lang.c (gfc_be_parse_file): Initialize mapped locations. * gfortran.h: Include input.h. (struct gfc_linebuf): Use source_location. * scanner.c (get_file): Initialize linemap. (preprocessor_line): Pass extra argument to get_file. (load_file): Ditto. Setup linemap. (gfc_new_file): Handle mapped locations. * trans-common.c (build_field, build_equiv_decl, build_common_decl): Set decl source locations. (gfc_trans_common): Set blank common block location. * trans-decl.c (gfc_set_decl_location): New function. (gfc_get_label_decl, gfc_get_symbol_decl): Use it. (trans_function_start): Move call to gfc_set_backend_locus.. (build_function_decl): ... to here. (build_entry_thunks): Set and restore the backend locus. (gfc_generate_constructors): Remove excess arguments to init_function_start. (gfc_generate_block_data): Add comments. Set the decl locus. * trans-io.c (set_error_locus): Handle mapped locations. * trans.c (gfc_get_backend_locus, gfc_get_backend_locus): Ditto. (gfc_trans_code): Use SET_EXPR_LOCATION. (gfc_generate_code): Override the location of the new symbol. * trans.h (gfc_set_decl_location): Add prototype. Co-Authored-By: Paul Brook From-SVN: r87142 --- gcc/fortran/f95-lang.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/fortran/f95-lang.c') diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 6018ec8..6a94611 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -280,6 +280,11 @@ 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_option.source, 1); + linemap_add (&line_table, LC_RENAME, false, "", 0); +#endif + /* First initialize the backend. */ gfc_init_decl_processing (); gfc_static_ctors = NULL_TREE; -- cgit v1.1