aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-05-26 19:27:58 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-05-26 19:27:58 +0000
commit6484716cf617de9bf0fbca8d1003fbc30898acc0 (patch)
tree10c996e7a3c75332fea7e26d8c2da608d15ddad6 /gcc
parentab9b814d258a26fc74f370b8fdb2b9250088794c (diff)
downloadgcc-6484716cf617de9bf0fbca8d1003fbc30898acc0.zip
gcc-6484716cf617de9bf0fbca8d1003fbc30898acc0.tar.gz
gcc-6484716cf617de9bf0fbca8d1003fbc30898acc0.tar.bz2
java-tree.h (struct lang_decl_func): Change type of throws_list field to a VEC.
* java-tree.h (struct lang_decl_func): Change type of throws_list field to a VEC. * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): Adjust for changed type of DECL_FUNCTION_THROWS. * class.c (make_method_value): Likewise. From-SVN: r159899
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/class.c15
-rw-r--r--gcc/java/java-tree.h2
-rw-r--r--gcc/java/jcf-parse.c7
4 files changed, 21 insertions, 11 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 6b8100d..62839b4 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,13 @@
2010-05-26 Nathan Froyd <froydnj@codesourcery.com>
+ * java-tree.h (struct lang_decl_func): Change type of throws_list
+ field to a VEC.
+ * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): Adjust for changed type
+ of DECL_FUNCTION_THROWS.
+ * class.c (make_method_value): Likewise.
+
+2010-05-26 Nathan Froyd <froydnj@codesourcery.com>
+
* class.c (utf8_decl_list): Delete.
(build_utf8_ref): Remove references to it.
* java-tree.h (all_class_list): Delete.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 5f91ddc..49299b8 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1519,18 +1519,19 @@ make_method_value (tree mdecl)
{
/* Compute the `throws' information for the method. */
tree table = null_pointer_node;
- if (DECL_FUNCTION_THROWS (mdecl) != NULL_TREE)
+ if (DECL_FUNCTION_THROWS (mdecl) != NULL)
{
- int length = 1 + list_length (DECL_FUNCTION_THROWS (mdecl));
- tree iter, type, array;
+ int length = 1 + VEC_length (tree, DECL_FUNCTION_THROWS (mdecl));
+ tree t, type, array;
char buf[60];
+ unsigned ix;
table = tree_cons (NULL_TREE, table, NULL_TREE);
- for (iter = DECL_FUNCTION_THROWS (mdecl);
- iter != NULL_TREE;
- iter = TREE_CHAIN (iter))
+ for (ix = 0;
+ VEC_iterate (tree, DECL_FUNCTION_THROWS (mdecl), ix, t);
+ ix++)
{
- tree sig = DECL_NAME (TYPE_NAME (TREE_VALUE (iter)));
+ tree sig = DECL_NAME (TYPE_NAME (t));
tree utf8
= build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (sig),
IDENTIFIER_LENGTH (sig)));
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 0482abe..83f3b3d 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -776,7 +776,7 @@ struct GTY(()) lang_decl_func {
int max_stack;
int arg_slot_count;
source_location last_line; /* End line number for a function decl */
- tree throws_list; /* Exception specified by `throws' */
+ VEC(tree,gc) *throws_list; /* Exception specified by `throws' */
tree exc_obj; /* Decl holding the exception object. */
/* Class initialization test variables */
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 9ce5561..eef75aa 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -936,13 +936,14 @@ handle_signature_attribute (int member_index, JCF *jcf,
#define HANDLE_EXCEPTIONS_ATTRIBUTE(COUNT) \
{ \
int n = COUNT; \
- tree list = DECL_FUNCTION_THROWS (current_method); \
+ VEC (tree,gc) *v = VEC_alloc (tree, gc, n); \
+ gcc_assert (DECL_FUNCTION_THROWS (current_method) == NULL); \
while (--n >= 0) \
{ \
tree thrown_class = get_class_constant (jcf, JCF_readu2 (jcf)); \
- list = tree_cons (NULL_TREE, thrown_class, list); \
+ VEC_quick_push (tree, v, thrown_class); \
} \
- DECL_FUNCTION_THROWS (current_method) = nreverse (list); \
+ DECL_FUNCTION_THROWS (current_method) = v; \
}
#define HANDLE_DEPRECATED_ATTRIBUTE() handle_deprecated ()