diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2016-01-10 04:30:02 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2016-01-10 04:30:02 +0000 |
commit | 81e81960e36b6c5e6faf80991aacac8d266c9d2e (patch) | |
tree | 9e2a60628d5569f31bbaab1ede2ba3f8057af3f7 /llvm/docs/ExceptionHandling.rst | |
parent | e28885e6936fc5487c9e11cda841282d2f43c9d1 (diff) | |
download | bcm5719-llvm-81e81960e36b6c5e6faf80991aacac8d266c9d2e.tar.gz bcm5719-llvm-81e81960e36b6c5e6faf80991aacac8d266c9d2e.zip |
[WinEH] Verify consistent funclet unwind exits
Summary:
A funclet EH pad may be exited by an unwind edge, which may be a
cleanupret exiting its cleanuppad, an invoke exiting a funclet, or an
unwind out of a nested funclet transitively exiting its parent. Funclet
EH personalities require all such exceptional exits from a given funclet to
have the same unwind destination, and EH preparation / state numbering /
table generation implicitly depends on this. Formalize it as a rule of
the IR in the LangRef and verifier.
Reviewers: rnk, majnemer, andrew.w.kaylor
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15962
llvm-svn: 257273
Diffstat (limited to 'llvm/docs/ExceptionHandling.rst')
-rw-r--r-- | llvm/docs/ExceptionHandling.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/docs/ExceptionHandling.rst b/llvm/docs/ExceptionHandling.rst index 25248568b61..9f46094d791 100644 --- a/llvm/docs/ExceptionHandling.rst +++ b/llvm/docs/ExceptionHandling.rst @@ -818,3 +818,20 @@ not-yet-exited pad (after exiting from any pads that the unwind edge exits), or "none" if there is no such pad. This ensures that the stack of executing funclets at run-time always corresponds to some path in the funclet pad tree that the parent tokens encode. + +All unwind edges which exit any given funclet pad (including ``cleanupret`` +edges exiting their ``cleanuppad`` and ``catchswitch`` edges exiting their +``catchswitch``) must share the same unwind destination. Similarly, any +funclet pad which may be exited by unwind to caller must not be exited by +any exception edges which unwind anywhere other than the caller. This +ensures that each funclet as a whole has only one unwind destination, which +EH tables for funclet personalities may require. Note that any unwind edge +which exits a ``catchpad`` also exits its parent ``catchswitch``, so this +implies that for any given ``catchswitch``, its unwind destination must also +be the unwind destination of any unwind edge that exits any of its constituent +``catchpad``\s. Because ``catchswitch`` has no ``nounwind`` variant, and +because IR producers are not *required* to annotate calls which will not +unwind as ``nounwind``, it is legal to nest a ``call`` or an "``unwind to +caller``\ " ``catchswitch`` within a funclet pad that has an unwind +destination other than caller; it is undefined behavior for such a ``call`` +or ``catchswitch`` to unwind. |