Go to file
Joseph Tremoulet b41632bf0f [Inliner/WinEH] Honor implicit nounwinds
Summary:
Funclet EH tables require that a given funclet have only one unwind
destination for exceptional exits.  The verifier will therefore reject
e.g. two cleanuprets with different unwind dests for the same cleanup, or
two invokes exiting the same funclet but to different unwind dests.
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.

Normally when inlining an invoke, calls in the inlined sequence are
rewritten to invokes that unwind to the callsite invoke's unwind
destination, and "unwind to caller" catchswitches in the inlined sequence
are rewritten to unwind to the callsite invoke's unwind destination.
However, if such a call or "unwind to caller" catchswitch is located in a
callee funclet that has another exceptional exit with an unwind
destination within the callee, applying the normal transformation would
give that callee funclet multiple unwind destinations for its exceptional
exits.  There would be no way for EH table generation to determine which
is the "true" exit, and the verifier would reject the function
accordingly.

Add logic to the inliner to detect these cases and leave such calls and
"unwind to caller" catchswitches as calls and "unwind to caller"
catchswitches in the inlined sequence.

This fixes PR26147.


Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: alexcrichton, llvm-commits

Differential Revision: http://reviews.llvm.org/D16319

llvm-svn: 258273
2016-01-20 02:15:15 +00:00
clang Module Debugging: Fine-tune the condition that determines whether a type 2016-01-20 01:29:34 +00:00
clang-tools-extra [clang-tidy] Python scripts shebang fixes 2016-01-19 16:10:39 +00:00
compiler-rt [coverage] Add a test case to cover coverage testing with comdat 2016-01-20 00:11:36 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc AMDGPU: Add aliases for all VI targets 2015-12-15 18:37:04 +00:00
libcxx Add link to 3rd party GDB pretty-printers 2016-01-20 01:26:30 +00:00
libcxxabi Recommit r256322: Fix PR25898 - Check for incomplete pointers types in can_catch(...) 2016-01-19 23:42:10 +00:00
libunwind Replace cmake check for printf with a check for fopen. 2015-12-10 00:47:08 +00:00
lld Add an ObjCPass to the MachO linker. 2016-01-19 21:54:21 +00:00
lldb Placate MVSC after my last commit. 2016-01-19 22:47:51 +00:00
llgo [llgo] Force exporting __morestack from llgoi 2015-11-27 04:46:46 +00:00
llvm [Inliner/WinEH] Honor implicit nounwinds 2016-01-20 02:15:15 +00:00
openmp lit.cfg: Pass -isysroot to the SDK on Darwin 2016-01-19 19:26:43 +00:00
polly Make sure we preserve alignment information after hoisting invariant load 2016-01-19 00:17:21 +00:00