<div dir="ltr"><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Hope that helps.</div><div><br></div><div><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 26, 2015 at 6:21 AM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Uh, a bit more involved than I hoped.<br>
Do you mean code in lib/CodeGen/ShadowStackGCLowering.cpp:EscapeEnumerator?<br>
How do I determine whether a Call can throw or not? Do I just assume the worst and replace all calls?<br>
Thanks<br>
<div class=""><div class="h5"><br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10740&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=9ujkGlII7iuYaQRESlXwGOGs3okRmaQ__EpdY37zroU&s=YaHTnTw6h3--bMUKC3NXZihjlerR968QrkobbOlzDZ0&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10740</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=9ujkGlII7iuYaQRESlXwGOGs3okRmaQ__EpdY37zroU&s=iQa9ZdxUr8aHx_cNPoAg9eHZ5C4rVdYgyQmpEKzH6wc&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br></div></div></div>