check-init.c (check_init): Handle USE_MAPPED_LOCATION case.
authorPer Bothner <per@bothner.com>
Thu, 30 Sep 2004 02:16:46 +0000 (19:16 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Thu, 30 Sep 2004 02:16:46 +0000 (19:16 -0700)
* 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

gcc/java/ChangeLog
gcc/java/check-init.c
gcc/java/decl.c
gcc/java/java-gimplify.c
gcc/java/jcf-write.c
gcc/java/lang.c

index 2ae9141835e8276856a76d261fb1b1c0aa436d07..c738401d4434db9a60fc3209bd628a5d84867540 100644 (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
index 3ec8d6488214d80119bc530405a7f0a46b81194f..be0485198eb96f2b7050cfaa1fb8cd8f2a41042d 100644 (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;
index 573fa2c9b0816083672da4b4c5e7d7ca6d54ea64..e10c9914869a0b0195be12c9c0d63c0b6f7a71b0 100644 (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, 
index 664eb9a6478ce3d1723c52fed8a7db326cdc80a1..c8130a717a8bde2b52c8e9b46f7450999f57ab53 100644 (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:
index 5137eecf2922600bd6dd3a8b1252dd8dc5f3f071..5f842ae7a3335e994f95efa38bd8082393483e7e 100644 (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);
index d1c69770787bf6910d17b2be211650faf777e20a..3e4ba4933fc1cfcdc9bf343294a802f0e6518df6 100644 (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;