diff options
author | Tom Tromey <tromey@redhat.com> | 2006-03-15 17:39:16 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2006-03-15 17:39:16 +0000 |
commit | 2afd35b3380c51f9eb6bab7ca37b2d883c4eb298 (patch) | |
tree | 4efa04a2cb1923b068a56fa30b0d3999ff1b18fa /gcc | |
parent | ff9d45906de3eee23784071f8e82a9d566d6d074 (diff) | |
download | gcc-2afd35b3380c51f9eb6bab7ca37b2d883c4eb298.zip gcc-2afd35b3380c51f9eb6bab7ca37b2d883c4eb298.tar.gz gcc-2afd35b3380c51f9eb6bab7ca37b2d883c4eb298.tar.bz2 |
* parse.y (analyze_clinit_body): Ignore empty statements.
From-SVN: r112092
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/java/parse.y | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index d80ff95..485e362 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2006-03-15 Tom Tromey <tromey@redhat.com> + + * parse.y (analyze_clinit_body): Ignore empty statements. + 2006-03-08 David Daney <ddaney@avtrex.com> * gcj.texi: Document -static-libgcj option. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 4ba1581..48a56d8 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -1,6 +1,6 @@ /* Source code parsing and tree node generation for the GNU compiler for the Java(TM) language. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) @@ -8006,7 +8006,8 @@ maybe_generate_pre_expand_clinit (tree class_type) } /* Analyzes a method body and look for something that isn't a - MODIFY_EXPR with a constant value. */ + MODIFY_EXPR with a constant value. Return true if <clinit> is + needed, false otherwise. */ static int analyze_clinit_body (tree this_class, tree bbody) @@ -8045,6 +8046,11 @@ analyze_clinit_body (tree this_class, tree bbody) || ! DECL_INITIAL (TREE_OPERAND (bbody, 0)) || DECL_CONTEXT (TREE_OPERAND (bbody, 0)) != this_class); + case NOP_EXPR: + /* We might see an empty statement here, which is + ignorable. */ + return ! IS_EMPTY_STMT (bbody); + default: return 1; } |