summaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-16 06:30:28 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-16 06:30:28 +0000
commit2a3fc102ae090ac3ca263d54d25e8b98dad8bdbd (patch)
tree67536e58400ed7f787f84efc053a21e12fed953e /gcc/java
parent869705e1ef9d6a40e9ef63b4b8c3f76eb89f0648 (diff)
downloadgcc-2a3fc102ae090ac3ca263d54d25e8b98dad8bdbd.tar.gz
* java-tree.h (BLOCK_IS_IMPLICIT): New flag.
* parse.h (BLOCK_EXPR_ORIGIN): Removed macro. * parse.y (declare_local_variables, maybe_absorb_scoping_blocks): Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40542 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/java-tree.h3
-rw-r--r--gcc/java/parse.h4
-rw-r--r--gcc/java/parse.y7
4 files changed, 11 insertions, 8 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 31c4d4c5a33..50efdcde427 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,10 @@
2001-03-15 Per Bothner <per@bothner.com>
+ * java-tree.h (BLOCK_IS_IMPLICIT): New flag.
+ * parse.h (BLOCK_EXPR_ORIGIN): Removed macro.
+ * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
+ Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
+
* jcf-parse.c (yyparse): Set/reset input_filename for source file.
* parse.y (java_expand_classes): Likewise.
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index f804a37cc4d..a2be1b3ef54 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -48,6 +48,7 @@ struct JCF;
IS_A_CLASSFILE_NAME (in IDENTIFIER_NODE)
COMPOUND_ASSIGN_P (in EXPR (binop_*))
LOCAL_CLASS_P (in RECORD_TYPE)
+ BLOCK_IS_IMPLICIT (in BLOCK)
2: RETURN_MAP_ADJUSTED (in TREE_VEC).
QUALIFIED_P (in IDENTIFIER_NODE)
PRIMARY_P (in EXPR_WITH_FILE_LOCATION)
@@ -1501,6 +1502,8 @@ extern tree *type_map;
#define BLOCK_EXPR_DECLS(NODE) BLOCK_VARS(NODE)
#define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE)
+/* True for an implicit block surrounding declaration not at start of {...}. */
+#define BLOCK_IS_IMPLICIT(NODE) TREE_LANG_FLAG_1 (NODE)
#define BUILD_MONITOR_ENTER(WHERE, ARG) \
{ \
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index 336c2fdbc9d..8a7bae56a1b 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -603,10 +603,6 @@ typedef struct _jdeplist {
#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)
-
/* Merge an other line to the source line number of a decl. Used to
remember function's end. */
#define DECL_SOURCE_LINE_MERGE(DECL,NO) DECL_SOURCE_LINE(DECL) |= (NO << 16)
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index b29d1708435..2100c66c245 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -6909,12 +6909,11 @@ declare_local_variables (modifier, type, vlist)
int final_p = 0;
/* Push a new block if statements were seen between the last time we
- pushed a block and now. Keep a cound of block to close */
+ pushed a block and now. Keep a count of blocks to close */
if (BLOCK_EXPR_BODY (GET_CURRENT_BLOCK (current_function_decl)))
{
- tree body = GET_CURRENT_BLOCK (current_function_decl);
tree b = enter_block ();
- BLOCK_EXPR_ORIGIN (b) = body;
+ BLOCK_IS_IMPLICIT (b) = 1;
}
if (modifier)
@@ -11962,7 +11961,7 @@ lookup_name_in_blocks (name)
static void
maybe_absorb_scoping_blocks ()
{
- while (BLOCK_EXPR_ORIGIN (GET_CURRENT_BLOCK (current_function_decl)))
+ while (BLOCK_IS_IMPLICIT (GET_CURRENT_BLOCK (current_function_decl)))
{
tree b = exit_block ();
java_method_add_stmt (current_function_decl, b);