aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2007-09-06 16:24:05 +0000
committerTom Tromey <tromey@gcc.gnu.org>2007-09-06 16:24:05 +0000
commit5ffeb913b1a455fe79c1c116fc75f09c21194815 (patch)
treeae71ddc2b3a15a8f7bcf6b36b1592c9fb9c5138e /gcc/java/jcf-parse.c
parent111f1fca4d2d4e4fabf92b39c4310a3add21f29a (diff)
downloadgcc-5ffeb913b1a455fe79c1c116fc75f09c21194815.zip
gcc-5ffeb913b1a455fe79c1c116fc75f09c21194815.tar.gz
gcc-5ffeb913b1a455fe79c1c116fc75f09c21194815.tar.bz2
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/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 397b187..ff2c999 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -365,7 +365,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;
+ line_table->maps[line_table->used-1].to_file = sfname;
#else
input_filename = sfname;
DECL_SOURCE_LOCATION (TYPE_NAME (current_class)) = input_location;
@@ -1209,8 +1209,8 @@ give_name_to_class (JCF *jcf, int i)
{
tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
const char *sfname = IDENTIFIER_POINTER (source_name);
- linemap_add (&line_table, LC_ENTER, false, sfname, 0);
- input_location = linemap_line_start (&line_table, 0, 1);
+ linemap_add (line_table, LC_ENTER, false, sfname, 0);
+ input_location = linemap_line_start (line_table, 0, 1);
file_start_location = input_location;
DECL_SOURCE_LOCATION (TYPE_NAME (this_class)) = input_location;
if (main_input_filename == NULL && jcf == main_jcf)
@@ -1497,7 +1497,7 @@ jcf_parse (JCF* jcf)
annotation_write_byte (JV_DONE_ATTR);
#ifdef USE_MAPPED_LOCATION
- linemap_add (&line_table, LC_LEAVE, false, NULL, 0);
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
#endif
/* The fields of class_type_node are already in correct order. */
@@ -1532,8 +1532,8 @@ 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);
+ 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;
@@ -1650,7 +1650,7 @@ parse_class_file (void)
}
#ifdef USE_MAPPED_LOCATION
if (min_line != 0)
- input_location = linemap_line_start (&line_table, min_line, 1);
+ input_location = linemap_line_start (line_table, min_line, 1);
#else
if (min_line != 0)
input_line = min_line;
@@ -1926,8 +1926,8 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
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);
+ 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);
@@ -1935,7 +1935,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
/* 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);
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
#endif
parse_zip_file_entries ();
}
@@ -1950,7 +1950,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
java_parser_context_restore_global ();
java_pop_parser_context (1);
#ifdef USE_MAPPED_LOCATION
- linemap_add (&line_table, LC_LEAVE, false, NULL, 0);
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
#endif
#endif
}