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
This commit is contained in:
Per Bothner 2004-09-29 19:16:46 -07:00 committed by Per Bothner
parent d68acc044e
commit de39930392
6 changed files with 28 additions and 2 deletions

View file

@ -7,6 +7,12 @@
* java-tree.def (EXPR_WITH_FILE_LOCATION): Only need two operands in
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>
PR java/17007

View file

@ -879,8 +879,12 @@ check_init (tree exp, words before)
if (IS_EMPTY_STMT (body))
break;
wfl = exp;
#ifdef USE_MAPPED_LOCATION
input_location = EXPR_LOCATION (exp);
#else
input_filename = EXPR_WFL_FILENAME (exp);
input_line = EXPR_WFL_LINENO (exp);
#endif
check_init (body, before);
input_location = saved_location;
wfl = saved_wfl;

View file

@ -1954,8 +1954,12 @@ finish_method (tree fndecl)
cfun = DECL_STRUCT_FUNCTION (fndecl);
else
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.line = DECL_FUNCTION_LAST_LINE (fndecl);
#endif
/* Defer inlining and expansion to the cgraph optimizers. */
cgraph_finalize_function (fndecl, false);
@ -2023,7 +2027,7 @@ tree
java_add_stmt (tree stmt)
{
if (input_filename)
annotate_with_locus (stmt, input_location);
SET_EXPR_LOCATION (stmt, input_location);
return current_binding_level->stmts
= add_stmt_to_compound (current_binding_level->stmts,

View file

@ -69,10 +69,14 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
break;
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.line = EXPR_WFL_LINENO (*expr_p);
#endif
*expr_p = EXPR_WFL_NODE (*expr_p);
annotate_with_locus (*expr_p, input_location);
SET_EXPR_LOCATION (*expr_p, input_location);
break;
case CASE_EXPR:

View file

@ -1479,8 +1479,12 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
tree body = EXPR_WFL_NODE (exp);
if (IS_EMPTY_STMT (body))
break;
#ifdef USE_MAPPED_LOCATION
input_location = EXPR_LOCATION (exp);
#else
input_filename = EXPR_WFL_FILENAME (exp);
input_line = EXPR_WFL_LINENO (exp);
#endif
if (EXPR_WFL_EMIT_LINE_NOTE (exp) && input_line > 0
&& debug_info_level > DINFO_LEVEL_NONE)
put_linenumber (input_line, state);

View file

@ -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. */
return false;