aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-08-18 17:57:03 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-08-18 18:57:03 +0100
commit260ba9ce680ed9ee88d427523e403f4667e6023e (patch)
tree0bf7d0c572a4f666bdfd34856e04e1f858b83cf2 /gcc/java/parse.y
parent62164eb49e501141f015c71410f625b2bf133570 (diff)
downloadgcc-260ba9ce680ed9ee88d427523e403f4667e6023e.zip
gcc-260ba9ce680ed9ee88d427523e403f4667e6023e.tar.gz
gcc-260ba9ce680ed9ee88d427523e403f4667e6023e.tar.bz2
class.c (make_local_function_alias): New function.
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. From-SVN: r86196
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y16
1 files changed, 4 insertions, 12 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index e1012a7..85be4b7 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