tree type;
tree init;
{
+ tree fn;
tree slot;
tree rval;
slot = build (VAR_DECL, type);
DECL_ARTIFICIAL (slot) = 1;
layout_decl (slot, 0);
- rval = build (AGGR_INIT_EXPR, type,
- TREE_OPERAND (init, 0), TREE_OPERAND (init, 1), slot);
+
+ /* We split the CALL_EXPR into its function and its arguments here.
+ Then, in expand_expr, we put them back together. The reason for
+ this is that this expression might be a default argument
+ expression. In that case, we need a new temporary every time the
+ expression is used. That's what break_out_target_exprs does; it
+ replaces every AGGR_INIT_EXPR with a copy that uses a fresh
+ temporary slot. Then, expand_expr builds up a call-expression
+ using the new slot. */
+ fn = TREE_OPERAND (init, 0);
+ rval = build (AGGR_INIT_EXPR, type, fn, TREE_OPERAND (init, 1), slot);
TREE_SIDE_EFFECTS (rval) = 1;
+ AGGR_INIT_VIA_CTOR_P (rval)
+ = (TREE_CODE (fn) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
+ && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0)));
rval = build (TARGET_EXPR, type, slot, rval, NULL_TREE, NULL_TREE);
TREE_SIDE_EFFECTS (rval) = 1;
if (type == error_mark_node)
return type;
-
+
+ if (type_quals == TYPE_QUALS (type))
+ return type;
+
/* A restrict-qualified pointer type must be a pointer (or reference)
to object or incomplete type. */
if ((type_quals & TYPE_QUAL_RESTRICT)
if (TREE_VIA_VIRTUAL (base_binfo))
continue;
- decl = build_lang_field_decl (FIELD_DECL, NULL_TREE, basetype);
+ decl = build_lang_decl (FIELD_DECL, NULL_TREE, basetype);
DECL_ARTIFICIAL (decl) = 1;
DECL_FIELD_CONTEXT (decl) = DECL_CLASS_CONTEXT (decl) = rec;
DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype);
goto got_it;
}
FORMAT_VBASE_NAME (name, basetype);
- decl = build_lang_field_decl (FIELD_DECL, get_identifier (name),
- build_pointer_type (basetype));
+ decl = build_lang_decl (FIELD_DECL, get_identifier (name),
+ build_pointer_type (basetype));
/* If you change any of the below, take a look at all the
other VFIELD_BASEs and VTABLE_BASEs in the code, and change
them too. */
\f
#define PRINT_RING_SIZE 4
-char *
+const char *
lang_printable_name (decl, v)
tree decl;
int v;
TRY (TREE_OPERAND (t, 2));
break;
+ case TRUTH_AND_EXPR:
+ case TRUTH_OR_EXPR:
+ case TRUTH_XOR_EXPR:
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
case PREDECREMENT_EXPR:
case CALL_EXPR:
case COMPOUND_EXPR:
case MODIFY_EXPR:
+ case INIT_EXPR:
TRY (TREE_OPERAND (t, 0));
TRY (TREE_OPERAND (t, 1));
break;
case CLEANUP_POINT_EXPR:
case LOOKUP_EXPR:
case THROW_EXPR:
+ case EXIT_EXPR:
+ case LOOP_EXPR:
TRY (TREE_OPERAND (t, 0));
break;
case ARROW_EXPR:
case DOTSTAR_EXPR:
case TYPEID_EXPR:
+ case PSEUDO_DTOR_EXPR:
break;
case COMPLEX_CST:
TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
return t;
+ case TRUTH_AND_EXPR:
+ case TRUTH_OR_EXPR:
+ case TRUTH_XOR_EXPR:
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
case PREDECREMENT_EXPR:
case WITH_CLEANUP_EXPR:
case COMPOUND_EXPR:
case MODIFY_EXPR:
+ case INIT_EXPR:
t = copy_node (t);
TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
return t;
case LOOKUP_EXPR:
+ case EXIT_EXPR:
+ case LOOP_EXPR:
t = copy_node (t);
TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
return t;
tree
build_min_nt VPROTO((enum tree_code code, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum tree_code code;
#endif
register struct obstack *ambient_obstack = expression_obstack;
VA_START (p, code);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
code = va_arg (p, enum tree_code);
#endif
tree
build_min VPROTO((enum tree_code code, tree tt, ...))
{
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
enum tree_code code;
tree tt;
#endif
VA_START (p, tt);
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
code = va_arg (p, enum tree_code);
tt = va_arg (p, tree);
#endif
/* The C++ version of unsave_expr_now.
See gcc/tree.c:unsave_expr_now for comments. */
-tree
+void
cplus_unsave_expr_now (expr)
tree expr;
{
if (expr == NULL)
- return expr;
+ return;
else if (TREE_CODE (expr) == AGGR_INIT_EXPR)
{
}
}
unsave_expr_now (TREE_OPERAND (expr,2));
- return expr;
+ return;
}
else
- return expr;
+ return;
}