diff options
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 92f032cb9d0..c97b12f88e3 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -39,7 +39,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "ggc.h" #include "debug.h" #include "cgraph.h" -#include "vecprim.h" #include "bitmap.h" #include "target.h" @@ -86,7 +85,7 @@ static location_t file_start_location; static GTY(()) struct JCF * main_jcf; /* A list of all the class DECLs seen so far. */ -static GTY(()) VEC(tree,gc) *all_class_list; +static GTY(()) vec<tree, va_gc> *all_class_list; /* The number of source files passed to us by -fsource-filename and an array of pointers to each name. Used by find_sourcefile(). */ @@ -744,7 +743,7 @@ rewrite_reflection_indexes (void *arg) { bitmap_iterator bi; unsigned int offset; - VEC(int, heap) *map = (VEC(int, heap) *) arg; + vec<int> *map = (vec<int> *) arg; unsigned char *data = TYPE_REFLECTION_DATA (current_class); if (map) @@ -753,7 +752,7 @@ rewrite_reflection_indexes (void *arg) { uint16 index = annotation_read_short (data + offset); annotation_rewrite_short - (VEC_index (int, map, index), data + offset); + ((*map)[index], data + offset); } } } @@ -933,12 +932,13 @@ handle_signature_attribute (int member_index, JCF *jcf, #define HANDLE_EXCEPTIONS_ATTRIBUTE(COUNT) \ { \ int n = COUNT; \ - VEC (tree,gc) *v = VEC_alloc (tree, gc, n); \ - gcc_assert (DECL_FUNCTION_THROWS (current_method) == NULL); \ + vec<tree, va_gc> *v; \ + vec_alloc (v, n); \ + gcc_assert (!DECL_FUNCTION_THROWS (current_method)); \ while (--n >= 0) \ { \ tree thrown_class = get_class_constant (jcf, JCF_readu2 (jcf)); \ - VEC_quick_push (tree, v, thrown_class); \ + v->quick_push (thrown_class); \ } \ DECL_FUNCTION_THROWS (current_method) = v; \ } @@ -1480,7 +1480,7 @@ jcf_parse (JCF* jcf) if (current_class == object_type_node) layout_class_methods (object_type_node); else - VEC_safe_push (tree, gc, all_class_list, TYPE_NAME (current_class)); + vec_safe_push (all_class_list, TYPE_NAME (current_class)); } /* If we came across inner classes, load them now. */ @@ -1512,7 +1512,7 @@ static void java_layout_seen_class_methods (void) { unsigned start = 0; - unsigned end = VEC_length (tree, all_class_list); + unsigned end = vec_safe_length (all_class_list); while (1) { @@ -1521,7 +1521,7 @@ java_layout_seen_class_methods (void) for (ix = start; ix != end; ix++) { - tree decl = VEC_index (tree, all_class_list, ix); + tree decl = (*all_class_list)[ix]; tree cls = TREE_TYPE (decl); input_location = DECL_SOURCE_LOCATION (decl); @@ -1534,7 +1534,7 @@ java_layout_seen_class_methods (void) /* Note that new classes might have been added while laying out methods, changing the value of all_class_list. */ - new_length = VEC_length (tree, all_class_list); + new_length = vec_safe_length (all_class_list); if (end != new_length) { start = end; @@ -1665,12 +1665,12 @@ parse_class_file (void) input_location = save_location; } -static VEC(tree,gc) *predefined_filenames; +static vec<tree, va_gc> *predefined_filenames; void add_predefined_file (tree name) { - VEC_safe_push (tree, gc, predefined_filenames, name); + vec_safe_push (predefined_filenames, name); } int @@ -1679,7 +1679,7 @@ predefined_filename_p (tree node) unsigned ix; tree f; - FOR_EACH_VEC_ELT (tree, predefined_filenames, ix, f) + FOR_EACH_VEC_SAFE_ELT (predefined_filenames, ix, f) if (f == node) return 1; @@ -1853,18 +1853,17 @@ java_parse_file (void) const char *resource_filename; /* Only one resource file may be compiled at a time. */ - gcc_assert (VEC_length (tree, all_translation_units) == 1); + gcc_assert (all_translation_units->length () == 1); resource_filename - = IDENTIFIER_POINTER - (DECL_NAME (VEC_index (tree, all_translation_units, 0))); + = IDENTIFIER_POINTER (DECL_NAME ((*all_translation_units)[0])); compile_resource_file (resource_name, resource_filename); goto finish; } current_jcf = main_jcf; - FOR_EACH_VEC_ELT (tree, all_translation_units, ix, node) + FOR_EACH_VEC_ELT (*all_translation_units, ix, node) { unsigned char magic_string[4]; char *real_path; @@ -1951,7 +1950,7 @@ java_parse_file (void) } } - FOR_EACH_VEC_ELT (tree, all_translation_units, ix, node) + FOR_EACH_VEC_ELT (*all_translation_units, ix, node) { input_location = DECL_SOURCE_LOCATION (node); if (CLASS_FILE_P (node)) |