You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
4.0 KiB
HTML
101 lines
4.0 KiB
HTML
<html lang="en">
|
|
<head>
|
|
<title>Cleanups - GNU Compiler Collection (GCC) Internals</title>
|
|
<meta http-equiv="Content-Type" content="text/html">
|
|
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
|
<meta name="generator" content="makeinfo 4.13">
|
|
<link title="Top" rel="start" href="index.html#Top">
|
|
<link rel="up" href="Statements.html#Statements" title="Statements">
|
|
<link rel="prev" href="Jumps.html#Jumps" title="Jumps">
|
|
<link rel="next" href="OpenMP.html#OpenMP" title="OpenMP">
|
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
|
<!--
|
|
Copyright (C) 1988-2015 Free Software Foundation, Inc.
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
|
any later version published by the Free Software Foundation; with the
|
|
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
|
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
|
(see below). A copy of the license is included in the section entitled
|
|
``GNU Free Documentation License''.
|
|
|
|
(a) The FSF's Front-Cover Text is:
|
|
|
|
A GNU Manual
|
|
|
|
(b) The FSF's Back-Cover Text is:
|
|
|
|
You have freedom to copy and modify this GNU Manual, like GNU
|
|
software. Copies published by the Free Software Foundation raise
|
|
funds for GNU development.-->
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
|
<style type="text/css"><!--
|
|
pre.display { font-family:inherit }
|
|
pre.format { font-family:inherit }
|
|
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
|
pre.smallformat { font-family:inherit; font-size:smaller }
|
|
pre.smallexample { font-size:smaller }
|
|
pre.smalllisp { font-size:smaller }
|
|
span.sc { font-variant:small-caps }
|
|
span.roman { font-family:serif; font-weight:normal; }
|
|
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
<div class="node">
|
|
<a name="Cleanups"></a>
|
|
<p>
|
|
Next: <a rel="next" accesskey="n" href="OpenMP.html#OpenMP">OpenMP</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="Jumps.html#Jumps">Jumps</a>,
|
|
Up: <a rel="up" accesskey="u" href="Statements.html#Statements">Statements</a>
|
|
<hr>
|
|
</div>
|
|
|
|
<h4 class="subsection">10.7.6 Cleanups</h4>
|
|
|
|
<p><a name="index-Cleanups-1942"></a>
|
|
Destructors for local C++ objects and similar dynamic cleanups are
|
|
represented in GIMPLE by a <code>TRY_FINALLY_EXPR</code>.
|
|
<code>TRY_FINALLY_EXPR</code> has two operands, both of which are a sequence
|
|
of statements to execute. The first sequence is executed. When it
|
|
completes the second sequence is executed.
|
|
|
|
<p>The first sequence may complete in the following ways:
|
|
|
|
<ol type=1 start=1>
|
|
|
|
<li>Execute the last statement in the sequence and fall off the
|
|
end.
|
|
|
|
<li>Execute a goto statement (<code>GOTO_EXPR</code>) to an ordinary
|
|
label outside the sequence.
|
|
|
|
<li>Execute a return statement (<code>RETURN_EXPR</code>).
|
|
|
|
<li>Throw an exception. This is currently not explicitly represented in
|
|
GIMPLE.
|
|
|
|
</ol>
|
|
|
|
<p>The second sequence is not executed if the first sequence completes by
|
|
calling <code>setjmp</code> or <code>exit</code> or any other function that does
|
|
not return. The second sequence is also not executed if the first
|
|
sequence completes via a non-local goto or a computed goto (in general
|
|
the compiler does not know whether such a goto statement exits the
|
|
first sequence or not, so we assume that it doesn't).
|
|
|
|
<p>After the second sequence is executed, if it completes normally by
|
|
falling off the end, execution continues wherever the first sequence
|
|
would have continued, by falling off the end, or doing a goto, etc.
|
|
|
|
<p><code>TRY_FINALLY_EXPR</code> complicates the flow graph, since the cleanup
|
|
needs to appear on every edge out of the controlled block; this
|
|
reduces the freedom to move code across these edges. Therefore, the
|
|
EH lowering pass which runs before most of the optimization passes
|
|
eliminates these expressions by explicitly adding the cleanup to each
|
|
edge. Rethrowing the exception is represented using <code>RESX_EXPR</code>.
|
|
|
|
</body></html>
|
|
|