<div dir="ltr">This sounds like <a href="https://llvm.org/bugs/show_bug.cgi?id=24233">https://llvm.org/bugs/show_bug.cgi?id=24233</a>.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 21, 2016 at 6:21 AM, koffie drinker via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I have the following code:</div><div><br></div><div>[use llvm to generate ir_func() ]</div><div><br></div><div>in side the ir_func() there's a call to a native cpp function that throws an exception.</div><div>(Just imagine changing the fibonacci example and calling a native c++ func that throws inside the fibonacci body)</div><div><br></div><div>I can't seem to catch "foreign" exception or any exception using the following pseudo code:</div><div><br></div><div>try {</div><div>// cast function ptr and execute</div><div>   ir_func();</div><div>} catch (const myEx&) {</div><div>} catch (...) {</div><div>}</div><div><br></div><div>Looking at:</div><div><dt></dt><dt><font color="#000000" face="Lucida Grande, Lucida Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px;line-height:21px"><b>LLVM_ENABLE_EH:BOOL</b></span></font></dt><dt><font color="#000000" face="Lucida Grande, Lucida Sans Unicode, Geneva, Verdana, sans-serif"><span style="font-size:14px;line-height:21px">Build LLVM with exception-handling support. This is necessary if you wish to link against LLVM libraries and make use of C++ exceptions in your own code that need to propagate through LLVM code. Defaults to OFF.</span></font></dt><dt><br></dt><dt>It seems to be exactly what I require. <br></dt><dt><br></dt></div><div>I enabled <span style="color:rgb(106,106,106);font-weight:bold;line-height:18.2px">LLVM_ENABLE_EH </span><span style="color:rgb(106,106,106);line-height:18.2px">and </span><span style="color:rgb(106,106,106);font-weight:bold;line-height:18.2px">LLVM_ENABLE_RTTI </span>but it doesn't seems to work.</div><div>I also tested it with /EHs /EHsc in msvc. It makes no difference</div><div><br></div><div>I also looked at the ExceptionDemo.cpp, but it seems to be unsupported under windows. Do I need to try catch and retrhow in my ir_func() ? </div><div><br></div><div>Regards,</div><div><br></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>