Commit 0a5fe110 by Tom Tromey Committed by Tom Tromey

expr.c (expand_byte_code): Set DECL_FUNCTION_LAST_LINE on method.

	* expr.c (expand_byte_code): Set DECL_FUNCTION_LAST_LINE on
	method.
	* java-tree.h (struct lang_decl_func): Remove obsolete comment.

From-SVN: r132767
parent b0fbea13
2008-02-29 Tom Tromey <tromey@redhat.com>
* expr.c (expand_byte_code): Set DECL_FUNCTION_LAST_LINE on
method.
* java-tree.h (struct lang_decl_func): Remove obsolete comment.
2008-02-26 Tom Tromey <tromey@redhat.com> 2008-02-26 Tom Tromey <tromey@redhat.com>
* lang.c (java_post_options): Remove conditional. * lang.c (java_post_options): Remove conditional.
......
...@@ -3132,6 +3132,7 @@ expand_byte_code (JCF *jcf, tree method) ...@@ -3132,6 +3132,7 @@ expand_byte_code (JCF *jcf, tree method)
int dead_code_index = -1; int dead_code_index = -1;
unsigned char* byte_ops; unsigned char* byte_ops;
long length = DECL_CODE_LENGTH (method); long length = DECL_CODE_LENGTH (method);
location_t max_location = input_location;
stack_pointer = 0; stack_pointer = 0;
JCF_SEEK (jcf, DECL_CODE_OFFSET (method)); JCF_SEEK (jcf, DECL_CODE_OFFSET (method));
...@@ -3219,6 +3220,8 @@ expand_byte_code (JCF *jcf, tree method) ...@@ -3219,6 +3220,8 @@ expand_byte_code (JCF *jcf, tree method)
{ {
int line = GET_u2 (linenumber_pointer - 2); int line = GET_u2 (linenumber_pointer - 2);
input_location = linemap_line_start (line_table, line, 1); input_location = linemap_line_start (line_table, line, 1);
if (input_location > max_location)
max_location = input_location;
if (!(instruction_bits[PC] & BCODE_HAS_MULTI_LINENUMBERS)) if (!(instruction_bits[PC] & BCODE_HAS_MULTI_LINENUMBERS))
break; break;
} }
...@@ -3238,6 +3241,8 @@ expand_byte_code (JCF *jcf, tree method) ...@@ -3238,6 +3241,8 @@ expand_byte_code (JCF *jcf, tree method)
warning (0, "unreachable bytecode from %d to the end of the method", warning (0, "unreachable bytecode from %d to the end of the method",
dead_code_index); dead_code_index);
} }
DECL_FUNCTION_LAST_LINE (method) = max_location;
} }
static void static void
......
/* Definitions for parsing and type checking for the GNU compiler for /* Definitions for parsing and type checking for the GNU compiler for
the Java(TM) language. the Java(TM) language.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007 Free Software Foundation, Inc. 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -793,8 +793,6 @@ struct lang_decl_func GTY(()) ...@@ -793,8 +793,6 @@ struct lang_decl_func GTY(())
int max_locals; int max_locals;
int max_stack; int max_stack;
int arg_slot_count; int arg_slot_count;
/* A temporary lie for the sake of ggc. Actually, last_line is
only a source_location if USE_MAPPED_LOCATION. FIXME. */
source_location last_line; /* End line number for a function decl */ source_location last_line; /* End line number for a function decl */
tree throws_list; /* Exception specified by `throws' */ tree throws_list; /* Exception specified by `throws' */
......
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