aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-05-27 13:05:34 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-05-27 14:05:34 +0100
commit062583ea1ced97a69fd5df986dada75c33c940d8 (patch)
treec1dd751dcb0f5da3c0e9e7f082fa77ff44a2560f
parent08fb03fdf38f9055a55007ab4782561ba48f1b04 (diff)
downloadgcc-062583ea1ced97a69fd5df986dada75c33c940d8.zip
gcc-062583ea1ced97a69fd5df986dada75c33c940d8.tar.gz
gcc-062583ea1ced97a69fd5df986dada75c33c940d8.tar.bz2
decl.c (struct binding_level): Add GTY marker.
* decl.c (struct binding_level): Add GTY marker. Compile binding_depth unconditionally. (current_binding_level, free_binding_level, global_binding_level): Likewise. (clear_binding_level): Unconditionally set binding_depth. (make_binding_level): Use ggc_alloc_cleared, not xmalloc. From-SVN: r82323
-rw-r--r--gcc/java/ChangeLog9
-rw-r--r--gcc/java/decl.c20
2 files changed, 16 insertions, 13 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a51d4a1..b3a951b 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,14 @@
2004-05-26 Bryce McKinlay <mckinlay@redhat.com>
+ * decl.c (struct binding_level): Add GTY marker. Compile
+ binding_depth unconditionally.
+ (current_binding_level, free_binding_level, global_binding_level):
+ Likewise.
+ (clear_binding_level): Unconditionally set binding_depth.
+ (make_binding_level): Use ggc_alloc_cleared, not xmalloc.
+
+2004-05-26 Bryce McKinlay <mckinlay@redhat.com>
+
* lex.c (java_new_lexer): Set 'encoding'.
(java_read_char): Improve error message for unrecognized characters.
* lex.h (struct java_lexer): New field 'encoding'.
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 7a36e54..632f0c8 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -281,7 +281,7 @@ find_stack_slot (int index, tree type)
type, -1);
}
-struct binding_level
+struct binding_level GTY(())
{
/* A chain of _DECL nodes for all variables, constants, functions,
* and typedef types. These are in the reverse of the order supplied.
@@ -314,27 +314,25 @@ struct binding_level
/* The statements in this binding level. */
tree stmts;
-#if defined(DEBUG_JAVA_BINDING_LEVELS)
- /* Binding depth at which this level began. */
+ /* Binding depth at which this level began. Used only for debugging. */
unsigned binding_depth;
-#endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */
};
#define NULL_BINDING_LEVEL (struct binding_level *) NULL
/* The binding level currently in effect. */
-static struct binding_level *current_binding_level;
+static GTY(()) struct binding_level *current_binding_level;
/* A chain of binding_level structures awaiting reuse. */
-static struct binding_level *free_binding_level;
+static GTY(()) struct binding_level *free_binding_level;
/* The outermost binding level, for names of file scope.
This is created when the compiler is started and exists
through the entire run. */
-static struct binding_level *global_binding_level;
+static GTY(()) struct binding_level *global_binding_level;
/* A PC value bigger than any PC value we may ever may encounter. */
@@ -344,11 +342,7 @@ static struct binding_level *global_binding_level;
static const struct binding_level clear_binding_level
= {NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
- NULL_BINDING_LEVEL, LARGEST_PC, 0, NULL,
-#if defined(DEBUG_JAVA_BINDING_LEVELS)
- 0,
-#endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */
-};
+ NULL_BINDING_LEVEL, LARGEST_PC, 0, NULL_TREE, 0};
#if 0
/* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
@@ -1200,7 +1194,7 @@ static struct binding_level *
make_binding_level (void)
{
/* NOSTRICT */
- return xmalloc (sizeof (struct binding_level));
+ return ggc_alloc_cleared (sizeof (struct binding_level));
}
void