aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2004-09-30 02:16:46 +0000
committerPer Bothner <per@bothner.com>2004-09-30 02:16:46 +0000
commit3962aa76c3b360958be7b183ae515f5c214f5df1 (patch)
treefbb1057171256a79143187457974d34107bf3d8f
parentf9f6d017004105f45384d3fafd547ba19cc1e56a (diff)
* 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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@88324 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/check-init.c4
-rw-r--r--gcc/java/decl.c6
-rw-r--r--gcc/java/java-gimplify.c6
-rw-r--r--gcc/java/jcf-write.c4
-rw-r--r--gcc/java/lang.c4
6 files changed, 28 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 2ae9141835e..c738401d443 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -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
diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c
index 3ec8d648821..be0485198eb 100644
--- a/gcc/java/check-init.c
+++ b/gcc/java/check-init.c
@@ -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;
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 573fa2c9b08..e10c9914869 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -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,
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 664eb9a6478..c8130a717a8 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -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:
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 5137eecf292..5f842ae7a33 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -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);
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index d1c69770787..3e4ba4933fc 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -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;