cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
* 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
This commit is contained in:
parent
e54635a2f3
commit
699ed0ce1f
4 changed files with 23 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
|||
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
|
||||
|
|
|
@ -395,10 +395,7 @@ build_call (function, result_type, parms)
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -70,6 +70,10 @@ DEFTREECODE (AGGR_INIT_EXPR, "aggr_init_expr", 'e', 3)
|
|||
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.
|
||||
|
|
|
@ -682,9 +682,10 @@ there is no @code{FIELD_DECL} for the ``base-class portion'' of an
|
|||
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}
|
||||
|
@ -1078,6 +1079,7 @@ the function.
|
|||
@tindex DO_STMT
|
||||
@findex DO_BODY
|
||||
@findex DO_COND
|
||||
@tindex EMPTY_CLASS_EXPR
|
||||
@tindex EXPR_STMT
|
||||
@findex EXPR_STMT_EXPR
|
||||
@tindex FOR_STMT
|
||||
|
@ -1286,6 +1288,12 @@ Used to represent a @code{do} loop. The body of the loop is given by
|
|||
@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
|
||||
|
|
Loading…
Add table
Reference in a new issue