[multiple changes]

2000-07-27  Tom Tromey  <tromey@cygnus.com>

        * parse.y (patch_method_invocation): Don't reverse the argument
        list when dealing with anonymous class constructors. Fixed typo in
        comment.

2000-07-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (build_alias_initializer_parameter_list): Reverse
        crafted list when building aliases for anonymous class
        constructors.

(http://gcc.gnu.org/ml/gcc-patches/2000-07/msg01146.html)

From-SVN: r35303
parent 7db51521
2000-07-27 Tom Tromey <tromey@cygnus.com>
* parse.y (patch_method_invocation): Don't reverse the argument
list when dealing with anonymous class constructors. Fixed typo in
comment.
2000-07-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (build_alias_initializer_parameter_list): Reverse
crafted list when building aliases for anonymous class
constructors.
2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com> 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (jdep_resolve_class): Don't bother checking potential * parse.y (jdep_resolve_class): Don't bother checking potential
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5006,6 +5006,8 @@ build_alias_initializer_parameter_list (mode, class_type, parm, artificial) ...@@ -5006,6 +5006,8 @@ build_alias_initializer_parameter_list (mode, class_type, parm, artificial)
int *artificial; int *artificial;
{ {
tree field; tree field;
tree additional_parms = NULL_TREE;
for (field = TYPE_FIELDS (class_type); field; field = TREE_CHAIN (field)) for (field = TYPE_FIELDS (class_type); field; field = TREE_CHAIN (field))
if (FIELD_LOCAL_ALIAS (field)) if (FIELD_LOCAL_ALIAS (field))
{ {
...@@ -5056,10 +5058,18 @@ build_alias_initializer_parameter_list (mode, class_type, parm, artificial) ...@@ -5056,10 +5058,18 @@ build_alias_initializer_parameter_list (mode, class_type, parm, artificial)
} }
break; break;
} }
parm = tree_cons (purpose, value, parm); additional_parms = tree_cons (purpose, value, additional_parms);
if (artificial) if (artificial)
*artificial +=1; *artificial +=1;
} }
if (additional_parms)
{
if (ANONYMOUS_CLASS_P (class_type)
&& mode == AIPL_FUNCTION_CTOR_INVOCATION)
additional_parms = nreverse (additional_parms);
parm = chainon (additional_parms, parm);
}
return parm; return parm;
} }
...@@ -9737,11 +9747,7 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl) ...@@ -9737,11 +9747,7 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
args = build_alias_initializer_parameter_list args = build_alias_initializer_parameter_list
(AIPL_FUNCTION_CTOR_INVOCATION, DECL_CONTEXT (list), args, NULL); (AIPL_FUNCTION_CTOR_INVOCATION, DECL_CONTEXT (list), args, NULL);
/* We have to reverse things. Find out why. FIXME */ /* Secretly pass the current_this/primary as a second argument */
if (ANONYMOUS_CLASS_P (DECL_CONTEXT (list)))
args = nreverse (args);
/* Secretely pass the current_this/primary as a second argument */
if (primary || current_this) if (primary || current_this)
args = tree_cons (NULL_TREE, (primary ? primary : current_this), args); args = tree_cons (NULL_TREE, (primary ? primary : current_this), args);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment