diff options
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 bc453bb..52d9917 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)), \ |