<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 style=""></dt><dt style=""><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 style=""><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 style=""><br></dt><dt style="">It seems to be exactly what I require. <br></dt><dt style=""><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>