diff options
author | Tom Tromey <tromey@redhat.com> | 2007-09-06 16:24:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-09-06 16:24:05 +0000 |
commit | 5ffeb913b1a455fe79c1c116fc75f09c21194815 (patch) | |
tree | ae71ddc2b3a15a8f7bcf6b36b1592c9fb9c5138e /gcc/fortran | |
parent | 111f1fca4d2d4e4fabf92b39c4310a3add21f29a (diff) | |
download | gcc-5ffeb913b1a455fe79c1c116fc75f09c21194815.tar.gz |
tree-cfg.c (remove_bb): Only warn if line is non-zero.
gcc:
* tree-cfg.c (remove_bb): Only warn if line is non-zero.
* c-pch.c (c_common_read_pch): Restore current location after
reading PCH file.
* tree.c (expand_location): Update.
(expr_filename): Changed return type. Unified the two cases.
(expr_lineno): Likewise.
(annotate_with_file_line): Don't use EXPR_LINENO and EXPR_FILENAME
as lvalues.
* toplev.c (line_table): Changed type.
(general_init): Update.
(realloc_for_line_map): New function.
(general_init): Allocate line_table using GC.
* fix-header.c (line_table): Changed type.
(read_scan_file): Update.
(read_scan_file): Update.
* c-ppoutput.c (maybe_print_line): Update.
(print_line): Update.
(cb_line_change): Update.
(cb_define): Update.
(pp_file_change): Update.
* c-opts.c (c_common_init_options): Update.
(finish_options): Update.
(push_command_line_include): Update.
* c-lex.c (cb_line_change): Update.
(cb_def_pragma): Update.
(cb_define): Update.
(cb_undef): Update.
(c_lex_with_flags): Use cpp_get_token_with_location.
* input.h (line_table): Changed type.
(location_from_locus): New macro.
* tree.h (EXPR_FILENAME): No longer an lvalue.
(EXPR_LINENO): Likewise.
(expr_locus, set_expr_locus): Declare separately for
USE_MAPPED_LOCATION.
(expr_filename, expr_lineno): Changed return type.
* gimplify.c (tree_to_gimple_tuple): Use SET_EXPR_LOCUS.
* cfgexpand.c (expand_gimple_cond_expr): Use location_from_locus.
(expand_gimple_basic_block): Likewise.
* final.c (final_scan_insn): Use expanded_location.
gcc/cp:
* decl.c (finish_function): Put return's location on line zero of
file.
gcc/fortran:
* scanner.c (get_file): Update.
(load_file): Update.
(gfc_next_char_literal): Use gfc_linebuf_linenum.
* f95-lang.c (gfc_init): Update.
* gfortran.h (gfc_linebuf_linenum): New macro.
gcc/java:
* lang.c (java_post_options): Update.
* jcf-parse.c (set_source_filename): Update.
(give_name_to_class): Update.
(jcf_parse): Update.
(duplicate_class_warning): Update.
(parse_class_file): Update.
(java_parse_file): Update.
* expr.c (expand_byte_code): Update.
gcc/testsuite:
* lib/g++.exp (g++_target_compile): Use -fno-show-column.
gcc/treelang:
* tree1.c (treelang_init): Update.
(treelang_parse_file): Update.
(treelang_parse_file): Update.
(treelang_parse_file): Update.
* lex.l: Update.
(update_lineno_charno): Likewise.
libcpp:
* internal.h (struct cpp_reader) <invocation_location>: New
field.
(struct cpp_reader) <set_invocation_location>: Likewise.
* init.c (cpp_set_line_map): New function.
* line-map.c (linemap_add): Use linemap's allocator.
* include/line-map.h (GTY): Define.
(line_map_realloc): New typedef.
(struct line_map): Mark with GTY.
(struct line_maps): Likewise.
(struct line_maps) <maps>: Likewise.
(struct line_maps) <reallocator>: New field.
* include/symtab.h (GTY): Conditionally define.
* include/cpplib.h (cpp_set_line_map): Declare.
(cpp_get_token_with_location): Declare.
* macro.c (cpp_get_token): Set invocation_location on the reader.
(cpp_get_token_with_location): New function.
From-SVN: r128190
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 4 | ||||
-rw-r--r-- | gcc/fortran/gfortran.h | 6 | ||||
-rw-r--r-- | gcc/fortran/scanner.c | 16 |
4 files changed, 24 insertions, 10 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 45bbac9ec82..8c941246199 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2007-09-06 Tom Tromey <tromey@redhat.com> + + * scanner.c (get_file): Update. + (load_file): Update. + (gfc_next_char_literal): Use gfc_linebuf_linenum. + * f95-lang.c (gfc_init): Update. + * gfortran.h (gfc_linebuf_linenum): New macro. + 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> * trans-decl.c (build_entry_thunks): Use set_cfun. diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 05f6750218d..b9eb1f852f0 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -316,8 +316,8 @@ 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); + 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. */ diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index bfd1af88b90..b2da38f4ebf 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -696,6 +696,12 @@ 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 { char *nextc; diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 844cfbf7f15..b0c7979554e 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -710,7 +710,7 @@ restart: /* We've got a continuation line. If we are on the very next line after the last continuation, increment the continuation line count and check whether the limit has been exceeded. */ - if (gfc_current_locus.lb->linenum == continue_line + 1) + if (gfc_linebuf_linenum (gfc_current_locus.lb) == continue_line + 1) { if (++continue_count == gfc_option.max_continue_free) { @@ -719,7 +719,7 @@ restart: "statement at %C", gfc_option.max_continue_free); } } - continue_line = gfc_current_locus.lb->linenum; + continue_line = gfc_linebuf_linenum (gfc_current_locus.lb); /* Now find where it continues. First eat any comment lines. */ openmp_cond_flag = skip_free_comments (); @@ -831,7 +831,7 @@ restart: /* We've got a continuation line. If we are on the very next line after the last continuation, increment the continuation line count and check whether the limit has been exceeded. */ - if (gfc_current_locus.lb->linenum == continue_line + 1) + if (gfc_linebuf_linenum (gfc_current_locus.lb) == continue_line + 1) { if (++continue_count == gfc_option.max_continue_fixed) { @@ -842,8 +842,8 @@ restart: } } - if (continue_line < gfc_current_locus.lb->linenum) - continue_line = gfc_current_locus.lb->linenum; + if (continue_line < gfc_linebuf_linenum (gfc_current_locus.lb)) + continue_line = gfc_linebuf_linenum (gfc_current_locus.lb); } /* Ready to read first character of continuation line, which might @@ -1170,7 +1170,7 @@ get_file (const char *name, enum lc_reason reason ATTRIBUTE_UNUSED) f->inclusion_line = current_file->line; #ifdef USE_MAPPED_LOCATION - linemap_add (&line_table, reason, false, f->filename, 1); + linemap_add (line_table, reason, false, f->filename, 1); #endif return f; @@ -1514,7 +1514,7 @@ load_file (const char *filename, bool initial) #ifdef USE_MAPPED_LOCATION b->location - = linemap_line_start (&line_table, current_file->line++, 120); + = linemap_line_start (line_table, current_file->line++, 120); #else b->linenum = current_file->line++; #endif @@ -1537,7 +1537,7 @@ load_file (const char *filename, bool initial) current_file = current_file->up; #ifdef USE_MAPPED_LOCATION - linemap_add (&line_table, LC_LEAVE, 0, NULL, 0); + linemap_add (line_table, LC_LEAVE, 0, NULL, 0); #endif return SUCCESS; } |