summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-24 01:43:49 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-24 01:43:49 +0000
commitf116beda8d5052bafb54e2e29a0ab689d995d0d6 (patch)
tree314de92967ee4099f64688b2b1f2d3feb6eb2785 /gcc/cp
parent33851d972ae0ab51103e297c70507389b5317ecc (diff)
downloadgcc-f116beda8d5052bafb54e2e29a0ab689d995d0d6.tar.gz
* ir.texi: Improve documentation for TARGET_EXPRs. Discuss
STMT_IS_FULL_EXPR_P. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29647 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/ir.texi26
2 files changed, 26 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 29aaa444e0f..216ecd01f2b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
1999-09-23 Mark Mitchell <mark@codesourcery.com>
+ * ir.texi: Improve documentation for TARGET_EXPRs. Discuss
+ STMT_IS_FULL_EXPR_P.
+
* cp-tree.h (language_function): Add cannot_inline.
* decl.c (start_function): Restore current_function_cannot_inline
from the saved value.
diff --git a/gcc/cp/ir.texi b/gcc/cp/ir.texi
index 3220a747627..e2b58e9e19b 100644
--- a/gcc/cp/ir.texi
+++ b/gcc/cp/ir.texi
@@ -1104,6 +1104,15 @@ as if it were a statement, they do not allow the use of
Statements do not contain information about
the file from which they came; that information is implicit in the
@code{FUNCTION_DECL} from which the statements originate.
+
+@item STMT_IS_FULL_EXPR_P
+In C++, statements normally constitute ``full expressions''; temporaries
+created during a statement are destroyed when the statement is complete.
+However, G++ sometimes represents expressions by statements; these
+statements will not have @code{STMT_IS_FULL_EXPR_P} set. Temporaries
+created during such statements should be destroyed when the innermost
+enclosing statement with @code{STMT_IS_FULL_EXPR_P} set is exited.
+
@end ftable
Here is the list of the various statement nodes, and the macros used to
@@ -1789,9 +1798,20 @@ is a @code{VAR_DECL} for the temporary variable. The second operand is
the initializer for the temporary. The initializer is evaluated, and
copied (bitwise) into the temporary.
-FIXME: Discuss cleanups for the variable.
-FIXME: Discuss the situation where the value is actually written into a
-different variable.
+The third operand to the @code{TARGET_EXPR}, if present, is a
+cleanup-expression (i.e., destructor call) for the temporary. If this
+expression is not copied into some other location (i.e., if it is not
+the right-hand side of an assignment, or the second operand to a
+comma-expression which is itself the right-hand side of an assignment,
+etc.), then this expression must be executed when the statement
+containing this expression is complete. These cleanups must always be
+executed in the order opposite to that in which they were encountered.
+Note that if a temporary is created on one branch of a conditional
+operator (i.e., in the second or third operand to a @code{COND_EXPR}),
+the cleanup must be run only if that branch is actually executed.
+
+See @code{STMT_IS_FULL_EXPR_P} for more information about running these
+cleanups.
@item AGGR_INIT_EXPR
An @code{AGGR_INIT_EXPR} represents the initialization as the return