[PATCH] tsan: support C++ exceptions

Reid Kleckner rnk at google.com
Mon Jun 29 09:36:54 PDT 2015


Think of 'resume' as 'ret' for exception handling. It means "transfer
control to the next landingpad up the stack", similar to how return
transfers to the return address. You could also insert your code before
every 'resume' if you want to avoid dealing branches, phis, etc.

The main complication is the split between calls and invokes. Effectively,
you need a transform that finds all potentially throwing callsites
(identified with `!CallSite->doesNotThrow()`) and turns them into invokes
with a trivial landingpad that immediately resumes. Then you can insert
code before the resume, or join all resumes together to avoid code
duplication.

Hope that helps.

On Fri, Jun 26, 2015 at 6:21 AM, Dmitry Vyukov <dvyukov at google.com> wrote:

> Uh, a bit more involved than I hoped.
> Do you mean code in lib/CodeGen/ShadowStackGCLowering.cpp:EscapeEnumerator?
> How do I determine whether a Call can throw or not? Do I just assume the
> worst and replace all calls?
> Thanks
>
>
> http://reviews.llvm.org/D10740
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150629/8fa2a28a/attachment.html>


More information about the llvm-commits mailing list