diff options
author | Richard Henderson <rth@redhat.com> | 2003-09-28 15:18:33 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-09-28 15:18:33 -0700 |
commit | 436fac170ae36308572b273a73510ae5510d1903 (patch) | |
tree | 92931566ca86595833d4e800dfd6d8299effef0c /gcc/java/jcf-parse.c | |
parent | b2ba71cad84307d8493518fb97e19f367578dc05 (diff) | |
download | gcc-436fac170ae36308572b273a73510ae5510d1903.zip gcc-436fac170ae36308572b273a73510ae5510d1903.tar.gz gcc-436fac170ae36308572b273a73510ae5510d1903.tar.bz2 |
c-decl.c (duplicate_decls): Copy DECL_SOURCE_LOCATION, not file and line separately.
* c-decl.c (duplicate_decls): Copy DECL_SOURCE_LOCATION, not
file and line separately.
f/
* com.c (duplicate_decls): Copy DECL_SOURCE_LOCATION, not
file and line separately.
java/
* check-init.c (check_init): Save and restore input_location
instead of file and line separately.
* decl.c (java_expand_body): Likewise.
* jcf-write.c (generate_bytecode_insns): Likewise.
* parse.y (safe_layout_class): Likewise.
* jcf-parse.c (read_class, parse_class_file): Likewise.
(java_parse_file): Use %H for warning locator.
From-SVN: r71886
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 9f4beb5..4abd6ce 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -472,7 +472,7 @@ read_class (tree name) JCF this_jcf, *jcf; tree icv, class = NULL_TREE; tree save_current_class = current_class; - const char *save_input_filename = input_filename; + location_t save_location = input_location; JCF *save_current_jcf = current_jcf; if ((icv = IDENTIFIER_CLASS_VALUE (name)) != NULL_TREE) @@ -550,7 +550,7 @@ read_class (tree name) } current_class = save_current_class; - input_filename = save_input_filename; + input_location = save_location; current_jcf = save_current_jcf; return 1; } @@ -703,8 +703,7 @@ static void parse_class_file (void) { tree method; - const char *save_input_filename = input_filename; - int save_lineno = input_line; + location_t save_location = input_location; java_layout_seen_class_methods (); @@ -799,9 +798,8 @@ parse_class_file (void) finish_class (); - (*debug_hooks->end_source_file) (save_lineno); - input_filename = save_input_filename; - input_line = save_lineno; + (*debug_hooks->end_source_file) (save_location.line); + input_location = save_location; } /* Parse a source file, as pointed by the current value of INPUT_FILENAME. */ @@ -984,10 +982,11 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) if (twice) { - const char *saved_input_filename = input_filename; - input_filename = value; - warning ("source file seen twice on command line and will be compiled only once"); - input_filename = saved_input_filename; + location_t warn_loc; + warn_loc.file = value; + warn_loc.line = 0; + warning ("%Hsource file seen twice on command line and " + "will be compiled only once", &warn_loc); } else { |