<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 2, 2010, at 4:45 AM, Duncan Sands wrote:</div><blockquote type="cite"><div><blockquote type="cite">I'm unhappy about how this bakes _Unwind_Resume into the backend, particularly<br></blockquote><blockquote type="cite">since that prevents us from using better alternatives when they're available<br></blockquote><blockquote type="cite">(e.g. the ARM EH ABI's _cxa_end_cleanup(), which saves code size by not requiring<br></blockquote><blockquote type="cite">the exception pointer, but which we can only use if we're linking in the C++ standard<br></blockquote><blockquote type="cite">library).<br></blockquote><br>the code generators can lower "unwind" to a call to _cxa_end_cleanup on that<br>platform.<br></div></blockquote><div><br></div>No, they can't, it's language-library-specific.  Only the frontend knows whether it's safe to</div><div>introduce that dependency.</div><div><br></div><div>Also, _Unwind_Resume has a slightly different name in ARM sjlj EH;  it would be great</div><div>if codegen didn't have to hard-code all this again.</div><div><br></div><div><blockquote type="cite"><div><blockquote type="cite">One idea that comes to mind is that we could make Yet Another call-like instruction,<br></blockquote><blockquote type="cite">a terminator like 'invoke' but with no successors and with the special<br></blockquote><blockquote type="cite">replaced-with-a-branch behavior when inlined through an invoke.  So the front-end<br></blockquote><blockquote type="cite">could call whatever function it pleases, taking responsibility for passing in the right<br></blockquote><blockquote type="cite">information.<br></blockquote><font class="Apple-style-span" color="#006312"><br></font>I think this is way too complicated.<br></div></blockquote><div><br></div>Then instead of using a call, it can be a special kind of unconditional branch which</div><div>the inliner rewrites into a normal branch;  that would look exactly like your "rewind"</div><div>instruction except for having a successor.</div><div><br></div><div>John.</div></body></html>