diff options
author | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-27 16:17:16 +0000 |
---|---|---|
committer | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-27 16:17:16 +0000 |
commit | a553c8ea8344e2ae3df2d332dcb002a81694afbc (patch) | |
tree | 5c845724777068a4a854675479295670fdb5e96e /gcc/java/parse.h | |
parent | c32584cdf79b115fa2b4697b5e8d23d5a103e74c (diff) | |
download | gcc-a553c8ea8344e2ae3df2d332dcb002a81694afbc.tar.gz |
Sat Mar 27 15:13:21 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
using a WFL compound value.
* parse.y (xref.h): Include.
(maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
WFL compound value.
(register_fields): Set WFL compound value to lineno if doing
xrefs.
(java_complete_expand_method): Call expand_xref if flag_emit_xref
is set.
* xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
* xref.h (expand_xref): Prototype renamed from xref_generate.
Sat Mar 27 14:16:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
(GET_CURRENT_BLOCK): New macro.
* parse.y (current_static_block): New global variable.
(method_body:): Define action.
(complete_method_declaration): Set current_function_decl to NULL
when work on the current method is done.
(declare_local_variables): Use GET_CURRENT_BLOCK.
(java_method_add_stmt): Likewise.
(java_complete_expand_method): Disable the use of `this' when
expanding <clinit>.
(enter_a_block): If no current method exist, use
current_static_block to link static initializer blocks.
(exit_block): Rewritten to use current_static_block when no current
method decl exists.
(lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
(patch_return): Forbid the use of `return' in static initializers.
(patch_throw_statement): Fixed indentation. Issue specific error
for uncaught thrown checked exception in static initializer
blocks. Removed FIXME.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26018 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/parse.h')
-rw-r--r-- | gcc/java/parse.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/java/parse.h b/gcc/java/parse.h index bc453bbbf76..52d9917df87 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -456,10 +456,15 @@ typedef struct _jdeplist { #define BLOCK_CHAIN_DECL(NODE) \ { \ TREE_CHAIN ((NODE)) = \ - BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (current_function_decl)); \ - BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (current_function_decl)) = (NODE); \ + BLOCK_EXPR_DECLS (GET_CURRENT_BLOCK (current_function_decl)); \ + BLOCK_EXPR_DECLS (GET_CURRENT_BLOCK (current_function_decl)) = (NODE); \ } +/* Return the current block, either found in the body of the currently + declared function or in the current static block being defined. */ +#define GET_CURRENT_BLOCK(F) ((F) ? DECL_FUNCTION_BODY ((F)) : \ + current_static_block) + /* For an artificial BLOCK (created to house a local variable declaration not at the start of an existing block), the parent block; otherwise NULL. */ #define BLOCK_EXPR_ORIGIN(NODE) BLOCK_ABSTRACT_ORIGIN(NODE) @@ -472,6 +477,13 @@ typedef struct _jdeplist { #define DECL_SOURCE_LINE_FIRST(DECL) (DECL_SOURCE_LINE(DECL) & 0x0000ffff) #define DECL_SOURCE_LINE_LAST(DECL) (DECL_SOURCE_LINE(DECL) >> 16) +/* Retrieve line/column from a WFL. */ +#define EXPR_WFL_GET_LINECOL(V,LINE,COL) \ + { \ + (LINE) = (V) >> 12; \ + (COL) = (V) & 0xfff; \ + } + /* Build a WFL for expression nodes */ #define BUILD_EXPR_WFL(NODE, WFL) \ build_expr_wfl ((NODE), input_filename, EXPR_WFL_LINENO ((WFL)), \ |