diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 1999-04-21 13:49:49 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 1999-04-21 06:49:49 -0700 |
commit | 5423609c57f756be5db8981d4ebb11a80d44f6e9 (patch) | |
tree | 6a4397f5304c150cbe5d79eab70071c1fe5a446a /gcc/java/parse.y | |
parent | 9d9cf1661deded9d4030041ba8a4dc6a80df78c7 (diff) | |
download | gcc-5423609c57f756be5db8981d4ebb11a80d44f6e9.zip gcc-5423609c57f756be5db8981d4ebb11a80d44f6e9.tar.gz gcc-5423609c57f756be5db8981d4ebb11a80d44f6e9.tar.bz2 |
decl.c (predef_filenames, [...]): New globals
Wed Apr 21 11:13:36 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (predef_filenames, predef_filenames_size): New globals
(init_decl_processing): predef_filenames and predef_filenames_size
initialized.
* java-tree.h (predef_filenames, predef_filenames_size): Declared
extern.
* jcf-parse.c (predefined_filename_p): New function.
(yyparse): Check that files on the command line are specified only
once and issue a warning otherwise.
* parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
* parse.y (source_end_java_method): Nullify NOP method bodies, to
avoid a gcc warning with -W -Wall turned on.
(java_expand_classes): Abort if errors were encountered.
(java_complete_lhs): If the cross reference flag is set, wrap
field DECL node around a WFL when resolving expression name.
From-SVN: r26578
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 8774576..4652ff2 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -5486,6 +5486,12 @@ source_end_java_method () /* Set EH language codes */ java_set_exception_lang_code (); + /* Turn function bodies with only a NOP expr null, so they don't get + generated at all and we won't get warnings when using the -W + -Wall flags. */ + if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) == empty_stmt_node) + BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) = NULL_TREE; + /* Generate function's code */ if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) && ! flag_emit_class_files @@ -5902,7 +5908,7 @@ java_expand_finals () void java_expand_classes () { - int save_error_count = java_error_count; + int save_error_count = 0; java_parse_abort_on_error (); if (!(ctxp = ctxp_for_generation)) return; @@ -7924,9 +7930,17 @@ java_complete_lhs (node) if (!EXPR_WFL_NODE (node) /* Or a PRIMARY flag ? */ || TREE_CODE (EXPR_WFL_NODE (node)) == IDENTIFIER_NODE) { + tree wfl = node; node = resolve_expression_name (node, NULL); if (node == error_mark_node) return node; + /* Keep line number information somewhere were it doesn't + disrupt the completion process. */ + if (flag_emit_xref) + { + EXPR_WFL_NODE (wfl) = TREE_OPERAND (node, 1); + TREE_OPERAND (node, 1) = wfl; + } CAN_COMPLETE_NORMALLY (node) = 1; } else |