<div dir="ltr">I think LLVM supports multiple catchrets, so that should work as long as they both return to the same parent function/funclet.<div><br></div><div>However, if you need to branch through multiple levels, you will probably have to set up an alloca used by a branch at the point of the return. This is what that would look like:<div><br></div><div>void f() {</div><div>  try { maythrow(); }</div><div>  catch (...) {</div><div>    try { maythrow(); }</div><div>    catch (...) {</div><div>      if (condition()) goto out; // need to thread the target through the cascading returns</div><div>      stuff();</div><div>    } // IR needs branch here</div><div>    stuff();</div><div>  } // IR needs branch here</div><div>  return 0;</div><div>out:</div><div>  return 1;</div><div>}</div></div><div><br></div><div>HTH</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 8, 2021 at 12:45 PM Carlo Kok via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If I need to branch out of the catch (catchpad) can I use a conditional catchret (ie have a catch with multiple catchret's) or do I have to branch to the end of the catch, and branch out from after the catchpad point?<br>
<br>
--<br>
Carlo Kok<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>