* cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
* call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
* expr.c (cplus_expand_expr): Expand it.
* ir.texi: Document EMPTY_CLASS_EXPR.
From-SVN: r30116
+1999-10-21 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
+ * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
+ * expr.c (cplus_expand_expr): Expand it.
+ * ir.texi: Document EMPTY_CLASS_EXPR.
+
1999-10-20 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
if (is_empty_class (TREE_TYPE (TREE_VALUE (tmp)))
&& ! TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (tmp))))
{
- tree t = make_node (RTL_EXPR);
- TREE_TYPE (t) = TREE_TYPE (TREE_VALUE (tmp));
- RTL_EXPR_RTL (t) = const0_rtx;
- RTL_EXPR_SEQUENCE (t) = NULL_RTX;
+ tree t = build (EMPTY_CLASS_EXPR, TREE_TYPE (TREE_VALUE (tmp)));
TREE_VALUE (tmp) = build (COMPOUND_EXPR, TREE_TYPE (t),
TREE_VALUE (tmp), t);
}
else it is NULL_TREE. */
DEFTREECODE (THROW_EXPR, "throw_expr", 'e', 1)
+/* An empty class object. The TREE_TYPE gives the class type. We use
+ these to avoid actually creating instances of the empty classes. */
+DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", 'e', 0)
+
/* Template definition. The following fields have the specified uses,
although there are other macros in cp-tree.h that should be used for
accessing this data.
object.
The @code{TYPE_VFIELD} is a compiler-generated field used to point to
-virtual function tables. It does not appear on the @code{TYPE_FIELDS}
-list. However, back-ends should handle the @code{TYPE_VFIELD} just like
-all the entries on the @code{TYPE_FIELDS} list.
+virtual function tables. It may or may not appear on the
+@code{TYPE_FIELDS} list. However, back-ends should handle the
+@code{TYPE_VFIELD} just like all the entries on the @code{TYPE_FIELDS}
+list.
The function members are available on the @code{TYPE_METHODS} list.
Again, subsequent members are found by following the @code{TREE_CHAIN}
@tindex DO_STMT
@findex DO_BODY
@findex DO_COND
+@tindex EMPTY_CLASS_EXPR
@tindex EXPR_STMT
@findex EXPR_STMT_EXPR
@tindex FOR_STMT
@code{DO_COND}. The condition for a @code{do}-statement is always an
expression.
+@item EMPTY_CLASS_EXPR
+
+Used to represent a temporary object of a class with no data whose
+address is never taken. (All such objects are interchangeable.) The
+@code{TREE_TYPE} represents the type of the object.
+
@item EXPR_STMT
Used to represent an expression statement. Use @code{EXPR_STMT_EXPR} to