aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/java-tree.h
diff options
context:
space:
mode:
authorRanjit Mathew <rmathew@hotmail.com>2004-05-29 05:11:41 +0000
committerRanjit Mathew <rmathew@gcc.gnu.org>2004-05-29 05:11:41 +0000
commitedf74484b2277d89da3d02da5ed694fd6fb0716f (patch)
treefa7c6c430b62609bd2e6979cf8f506515595ec7f /gcc/java/java-tree.h
parent27e1a8d2eebf19730394a178567c775dd39ac248 (diff)
downloadgcc-edf74484b2277d89da3d02da5ed694fd6fb0716f.zip
gcc-edf74484b2277d89da3d02da5ed694fd6fb0716f.tar.gz
gcc-edf74484b2277d89da3d02da5ed694fd6fb0716f.tar.bz2
java-tree.h (DECL_LOCAL_FINAL_IUD): New macro to test if a local variable was initialised upon declaration.
* 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. Co-Authored-By: Per Bothner <per@bothner.com> From-SVN: r82416
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 b04ee4b..64c0778 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. */