diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-18 17:57:03 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-18 17:57:03 +0000 |
commit | 0a84551d12a1d4f6af5ce076f0e2acbeee0b5e83 (patch) | |
tree | 0bf7d0c572a4f666bdfd34856e04e1f858b83cf2 /gcc/java/parse.y | |
parent | 956dd562b6f5013b42e76cc8abf9f71cca2da650 (diff) | |
download | gcc-0a84551d12a1d4f6af5ce076f0e2acbeee0b5e83.tar.gz |
2004-08-18 Bryce McKinlay <mckinlay@redhat.com>
* class.c (make_local_function_alias): New function. Create local
alias for public method DECL.
(make_method_value): Use make_local_function_alias.
* parse.y (craft_constructor): Don't special-case anonymous classes.
Always set ctor_name to init_identifier_node.
(lookup_method_invoke): Call layout_class_method when creating
anonymous class constructor.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86196 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index e1012a7c485..85be4b71bf4 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -5422,13 +5422,7 @@ craft_constructor (tree class_decl, tree args) tree decl, ctor_name; char buffer [80]; - /* The constructor name is <init> unless we're dealing with an - anonymous class, in which case the name will be fixed after having - be expanded. */ - if (ANONYMOUS_CLASS_P (class_type)) - ctor_name = DECL_NAME (class_decl); - else - ctor_name = init_identifier_node; + ctor_name = init_identifier_node; /* If we're dealing with an inner class constructor, we hide the this$<n> decl in the name field of its parameter declaration. */ @@ -10930,12 +10924,10 @@ lookup_method_invoke (int lc, tree cl, tree class, tree name, tree arg_list) if (lc && ANONYMOUS_CLASS_P (class)) { - tree saved_current_class; tree mdecl = craft_constructor (TYPE_NAME (class), atl); - saved_current_class = current_class; - current_class = class; - fix_constructors (mdecl); - current_class = saved_current_class; + /* The anonymous class may have already been laid out, so make sure + the new constructor is laid out here. */ + layout_class_method (class, CLASSTYPE_SUPER (class), mdecl, NULL_TREE); } /* Find all candidates and then refine the list, searching for the |