summaryrefslogtreecommitdiff
path: root/gcc/java/java-tree.h
diff options
context:
space:
mode:
authorrmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-29 05:11:41 +0000
committerrmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-29 05:11:41 +0000
commitb058b5b4a94939c18b568d90b3c1c1a2acb1459f (patch)
treefa7c6c430b62609bd2e6979cf8f506515595ec7f /gcc/java/java-tree.h
parent972e98ddf92b3a62cda27f1c296052561d5ac76c (diff)
downloadgcc-b058b5b4a94939c18b568d90b3c1c1a2acb1459f.tar.gz
* java-tree.h (DECL_LOCAL_FINAL_IUD): New macro to test if a
local variable was initialised upon declaration. * parse.y (declare_local_variables): Set DECL_LOCAL_FINAL_IUD if variable was final and initialised upon declaration. * check-init.c (check_final_reassigned): Give error only if a blank final is not definitely unassigned or if an initialised final is reassigned. (check_bool_init): Respect JLS2 16.1.7 requirements for boolean assignment expressions. Remove case MODIFY_EXPR, label do_default. (check_init): Perform initialised-variable-removing-optimisation only on non-final local variables. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82416 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/java-tree.h')
-rw-r--r--gcc/java/java-tree.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index b04ee4b0a95..64c07784d23 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -902,8 +902,8 @@ union lang_tree_node
/* Safely tests whether FIELD_INNER_ACCESS exists or not. */
#define FIELD_INNER_ACCESS_P(DECL) \
DECL_LANG_SPECIFIC (DECL) && FIELD_INNER_ACCESS (DECL)
-/* True if a final variable was initialized upon its declaration,
- or (if a field) in an initializer. Set after definite assignment. */
+/* True if a final field was initialized upon its declaration
+ or in an initializer. Set after definite assignment. */
#define DECL_FIELD_FINAL_IUD(NODE) (DECL_LANG_SPECIFIC (NODE)->u.v.final_iud)
/* The original WFL of a final variable. */
#define DECL_FIELD_FINAL_WFL(NODE) (DECL_LANG_SPECIFIC(NODE)->u.v.wfl)
@@ -911,6 +911,8 @@ union lang_tree_node
#define DECL_OWNER(NODE) (DECL_LANG_SPECIFIC(NODE)->u.v.owner)
/* True if NODE is a local variable final. */
#define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE))
+/* True if a final local variable was initialized upon its declaration. */
+#define DECL_LOCAL_FINAL_IUD(NODE) (DECL_LANG_SPECIFIC (NODE)->u.v.final_iud)
/* True if NODE is a final field. */
#define FINAL_VARIABLE_P(NODE) (FIELD_FINAL (NODE) && !FIELD_STATIC (NODE))
/* True if NODE is a class final field. */