Commit de399303 by Per Bothner Committed by Per Bothner

check-init.c (check_init): Handle USE_MAPPED_LOCATION case.


	* check-init.c (check_init): Handle USE_MAPPED_LOCATION case.
	* decl.c (finish_method, java_add_stmt): Likewise.
	* java-gimplify.c (java-gimplify.c):  Likewise.
	* jcf-write.c (generate_bytecode_insns):  Likewise.
	* lang.c (java_post_options): Likewise - call linemap_add.

From-SVN: r88324
parent d68acc04
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
* java-tree.def (EXPR_WITH_FILE_LOCATION): Only need two operands in * java-tree.def (EXPR_WITH_FILE_LOCATION): Only need two operands in
USE_MAPPED_LOCATION case, since EXPR_WFL_FILENAME_NODE is gone. USE_MAPPED_LOCATION case, since EXPR_WFL_FILENAME_NODE is gone.
* check-init.c (check_init): Handle USE_MAPPED_LOCATION case.
* decl.c (finish_method, java_add_stmt): Likewise.
* java-gimplify.c (java-gimplify.c): Likewise.
* jcf-write.c (generate_bytecode_insns): Likewise.
* lang.c (java_post_options): Likewise - call linemap_add.
2004-09-29 Andrew Haley <aph@redhat.com> 2004-09-29 Andrew Haley <aph@redhat.com>
PR java/17007 PR java/17007
......
...@@ -879,8 +879,12 @@ check_init (tree exp, words before) ...@@ -879,8 +879,12 @@ check_init (tree exp, words before)
if (IS_EMPTY_STMT (body)) if (IS_EMPTY_STMT (body))
break; break;
wfl = exp; wfl = exp;
#ifdef USE_MAPPED_LOCATION
input_location = EXPR_LOCATION (exp);
#else
input_filename = EXPR_WFL_FILENAME (exp); input_filename = EXPR_WFL_FILENAME (exp);
input_line = EXPR_WFL_LINENO (exp); input_line = EXPR_WFL_LINENO (exp);
#endif
check_init (body, before); check_init (body, before);
input_location = saved_location; input_location = saved_location;
wfl = saved_wfl; wfl = saved_wfl;
......
...@@ -1954,8 +1954,12 @@ finish_method (tree fndecl) ...@@ -1954,8 +1954,12 @@ finish_method (tree fndecl)
cfun = DECL_STRUCT_FUNCTION (fndecl); cfun = DECL_STRUCT_FUNCTION (fndecl);
else else
allocate_struct_function (fndecl); allocate_struct_function (fndecl);
#ifdef USE_MAPPED_LOCATION
cfun->function_end_locus = DECL_FUNCTION_LAST_LINE (fndecl);
#else
cfun->function_end_locus.file = DECL_SOURCE_FILE (fndecl); cfun->function_end_locus.file = DECL_SOURCE_FILE (fndecl);
cfun->function_end_locus.line = DECL_FUNCTION_LAST_LINE (fndecl); cfun->function_end_locus.line = DECL_FUNCTION_LAST_LINE (fndecl);
#endif
/* Defer inlining and expansion to the cgraph optimizers. */ /* Defer inlining and expansion to the cgraph optimizers. */
cgraph_finalize_function (fndecl, false); cgraph_finalize_function (fndecl, false);
...@@ -2023,7 +2027,7 @@ tree ...@@ -2023,7 +2027,7 @@ tree
java_add_stmt (tree stmt) java_add_stmt (tree stmt)
{ {
if (input_filename) if (input_filename)
annotate_with_locus (stmt, input_location); SET_EXPR_LOCATION (stmt, input_location);
return current_binding_level->stmts return current_binding_level->stmts
= add_stmt_to_compound (current_binding_level->stmts, = add_stmt_to_compound (current_binding_level->stmts,
......
...@@ -69,10 +69,14 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, ...@@ -69,10 +69,14 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
break; break;
case EXPR_WITH_FILE_LOCATION: case EXPR_WITH_FILE_LOCATION:
#ifdef USE_MAPPED_LOCATION
input_location = EXPR_LOCATION (*expr_p);
#else
input_location.file = EXPR_WFL_FILENAME (*expr_p); input_location.file = EXPR_WFL_FILENAME (*expr_p);
input_location.line = EXPR_WFL_LINENO (*expr_p); input_location.line = EXPR_WFL_LINENO (*expr_p);
#endif
*expr_p = EXPR_WFL_NODE (*expr_p); *expr_p = EXPR_WFL_NODE (*expr_p);
annotate_with_locus (*expr_p, input_location); SET_EXPR_LOCATION (*expr_p, input_location);
break; break;
case CASE_EXPR: case CASE_EXPR:
......
...@@ -1479,8 +1479,12 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -1479,8 +1479,12 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
tree body = EXPR_WFL_NODE (exp); tree body = EXPR_WFL_NODE (exp);
if (IS_EMPTY_STMT (body)) if (IS_EMPTY_STMT (body))
break; break;
#ifdef USE_MAPPED_LOCATION
input_location = EXPR_LOCATION (exp);
#else
input_filename = EXPR_WFL_FILENAME (exp); input_filename = EXPR_WFL_FILENAME (exp);
input_line = EXPR_WFL_LINENO (exp); input_line = EXPR_WFL_LINENO (exp);
#endif
if (EXPR_WFL_EMIT_LINE_NOTE (exp) && input_line > 0 if (EXPR_WFL_EMIT_LINE_NOTE (exp) && input_line > 0
&& debug_info_level > DINFO_LEVEL_NONE) && debug_info_level > DINFO_LEVEL_NONE)
put_linenumber (input_line, state); put_linenumber (input_line, state);
......
...@@ -668,6 +668,10 @@ java_post_options (const char **pfilename) ...@@ -668,6 +668,10 @@ java_post_options (const char **pfilename)
} }
} }
} }
#ifdef USE_MAPPED_LOCATION
linemap_add (&line_table, LC_ENTER, false, filename, 0);
linemap_add (&line_table, LC_RENAME, false, "<built-in>", 0);
#endif
/* Initialize the compiler back end. */ /* Initialize the compiler back end. */
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment