diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-28 22:18:33 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-28 22:18:33 +0000 |
commit | 7512c2dbfaef85fc5d84fb45064c3fa365ad380b (patch) | |
tree | 92931566ca86595833d4e800dfd6d8299effef0c /gcc/java | |
parent | fcb934914828f47f460119414dfbb86e8e95c737 (diff) | |
download | gcc-7512c2dbfaef85fc5d84fb45064c3fa365ad380b.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71886 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/java/check-init.c | 6 | ||||
-rw-r--r-- | gcc/java/decl.c | 9 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 21 | ||||
-rw-r--r-- | gcc/java/jcf-write.c | 6 | ||||
-rw-r--r-- | gcc/java/parse.y | 6 |
6 files changed, 29 insertions, 29 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4ec9a3c6578..f2a990cdf62 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,13 @@ +2003-09-28 Richard Henderson <rth@redhat.com> + + * 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. + 2003-09-28 Roger Sayle <roger@eyesopen.com> * expr.c (java_check_reference): Use the semantics of COND_EXPRs diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c index 03af2faf1cf..c4e39484410 100644 --- a/gcc/java/check-init.c +++ b/gcc/java/check-init.c @@ -886,18 +886,16 @@ check_init (tree exp, words before) case EXPR_WITH_FILE_LOCATION: { - const char *saved_input_filename = input_filename; + location_t saved_location = input_location; tree saved_wfl = wfl; tree body = EXPR_WFL_NODE (exp); - int saved_lineno = input_line; if (body == empty_stmt_node) break; wfl = exp; input_filename = EXPR_WFL_FILENAME (exp); input_line = EXPR_WFL_LINENO (exp); check_init (body, before); - input_filename = saved_input_filename; - input_line = saved_lineno; + input_location = saved_location; wfl = saved_wfl; } break; diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 074a0931984..4e413de897d 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1816,12 +1816,10 @@ end_java_method (void) void java_expand_body (tree fndecl) { - const char *saved_input_filename = input_filename; - int saved_lineno = input_line; + location_t saved_location = input_location; current_function_decl = fndecl; - input_filename = DECL_SOURCE_FILE (fndecl); - input_line = DECL_SOURCE_LINE (fndecl); + input_location = DECL_SOURCE_LOCATION (fndecl); timevar_push (TV_EXPAND); @@ -1858,8 +1856,7 @@ java_expand_body (tree fndecl) timevar_pop (TV_EXPAND); - input_filename = saved_input_filename; - input_line = saved_lineno; + input_location = saved_location; current_function_decl = NULL_TREE; } diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 9f4beb5b3a3..4abd6ceac6e 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 { diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index aed6eb9773b..b4a9e1b6876 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -1417,9 +1417,8 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) break; case EXPR_WITH_FILE_LOCATION: { - const char *saved_input_filename = input_filename; + location_t saved_location = input_location; tree body = EXPR_WFL_NODE (exp); - int saved_lineno = input_line; if (body == empty_stmt_node) break; input_filename = EXPR_WFL_FILENAME (exp); @@ -1428,8 +1427,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) && debug_info_level > DINFO_LEVEL_NONE) put_linenumber (input_line, state); generate_bytecode_insns (body, target, state); - input_filename = saved_input_filename; - input_line = saved_lineno; + input_location = saved_location; } break; case INTEGER_CST: diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 3b38a1eb3bf..541e2b2429a 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -5461,14 +5461,12 @@ void safe_layout_class (tree class) { tree save_current_class = current_class; - const char *save_input_filename = input_filename; - int save_lineno = input_line; + location_t save_location = input_location; layout_class (class); current_class = save_current_class; - input_filename = save_input_filename; - input_line = save_lineno; + input_location = save_location; } static tree |