diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2005-05-19 11:16:27 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2005-05-19 11:16:27 +0000 |
commit | 6fb09909fc300c5f5844e000bb5136ad164d7996 (patch) | |
tree | 2257d145db3794b4bec14070246573ea1c8cb8bc /gcc | |
parent | e42922b1ae4c3da94882d3a92ce978a0db123064 (diff) | |
download | gcc-6fb09909fc300c5f5844e000bb5136ad164d7996.zip gcc-6fb09909fc300c5f5844e000bb5136ad164d7996.tar.gz gcc-6fb09909fc300c5f5844e000bb5136ad164d7996.tar.bz2 |
re PR java/17845 (More problems with simple type names as superclasses)
2005-05-19 Paolo Bonzini <bonzini@gnu.org>
PR java/17845
* parse.y (register_package, package_list): Remove.
(package_declaration): Do not call register_package.
(do_resolve_class): Do not use package_list.
From-SVN: r99977
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/java/parse.y | 42 |
2 files changed, 8 insertions, 42 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 5af0805..9cfbe0a 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,11 @@ +2005-05-19 Paolo Bonzini <bonzini@gnu.org> + + PR java/17845 + + * parse.y (register_package, package_list): Remove. + (package_declaration): Do not call register_package. + (do_resolve_class): Do not use package_list. + 2005-05-15 Gerald Pfeifer <gerald@pfeifer.com> * jcf-write.c (generate_bytecode_insns) <SAVE_EXPR>: Remove diff --git a/gcc/java/parse.y b/gcc/java/parse.y index b4facbb..e90fc42 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -113,7 +113,6 @@ static int find_in_imports_on_demand (tree, tree); static void find_in_imports (tree, tree); static void check_inner_class_access (tree, tree, tree); static int check_pkg_class_access (tree, tree, bool, tree); -static void register_package (tree); static tree resolve_package (tree, tree *, tree *); static tree resolve_class (tree, tree, tree, tree); static void declare_local_variables (int, tree, tree); @@ -408,9 +407,6 @@ static GTY(()) tree current_static_block; /* The generated `write_parm_value$' identifier. */ static GTY(()) tree wpv_id; -/* The list of all packages we've seen so far */ -static GTY(()) tree package_list; - /* Hold THIS for the scope of the current method decl. */ static GTY(()) tree current_this; @@ -738,7 +734,6 @@ package_declaration: PACKAGE_TK name SC_TK { ctxp->package = EXPR_WFL_NODE ($2); - register_package (ctxp->package); } | PACKAGE_TK error {yyerror ("Missing name"); RECOVER;} @@ -5970,22 +5965,6 @@ do_resolve_class (tree enclosing, tree import_type, tree class_type, tree decl, if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)))) return new_class_decl; - /* 5- Try with a name qualified with the package name we've seen so far */ - if (!QUALIFIED_P (TYPE_NAME (class_type))) - { - tree package; - - /* If there is a current package (ctxp->package), it's the first - element of package_list and we can skip it. */ - for (package = (ctxp->package ? - TREE_CHAIN (package_list) : package_list); - package; package = TREE_CHAIN (package)) - if ((new_class_decl = qualify_and_find (class_type, - TREE_PURPOSE (package), - TYPE_NAME (class_type)))) - return new_class_decl; - } - /* 5- Check another compilation unit that bears the name of type */ load_class (TYPE_NAME (class_type), 0); @@ -7247,27 +7226,6 @@ find_in_imports_on_demand (tree enclosing_type, tree class_type) return (seen_once < 0 ? 0 : seen_once); /* It's ok not to have found */ } -/* Add package NAME to the list of packages encountered so far. To - speed up class lookup in do_resolve_class, we make sure a - particular package is added only once. */ - -static void -register_package (tree name) -{ - static htab_t pht; - void **e; - - if (pht == NULL) - pht = htab_create (50, htab_hash_pointer, htab_eq_pointer, NULL); - - e = htab_find_slot (pht, name, INSERT); - if (*e == NULL) - { - package_list = chainon (package_list, build_tree_list (name, NULL)); - *e = name; - } -} - static tree resolve_package (tree pkg, tree *next, tree *type_name) { |