On Jan 28, 2009, at 1:20 AM, Duncan Sands wrote:> Hi John, > >> I have what appears to be a bug in LLVM... I'm deeply hesitant to >> label it a bug, given my lack of experience with LLVM, but the >> behaviour of this fragment strongly suggests a bug. > > this is a frequently asked question. The LLVM code generators > currently do not support unwind. As far as I know the only > back-end that supports it is the interpreter. You may wonder > how llvm-gcc manages to support exception handling? It calls > the unwind routine in the gcc library, which takes care of > unwinding the stack. The LLVM exception *catching* stuff works > fine, but *throwing* (unwind) is trickier to get working which > is why no one did it yet. I have a plan for implementing it, > but it is low on my list of priorities...Thanks for your prompt response! If I understand you correctly, one interim measure would be to update the code generators that don't support unwind to explicitly signal an error, no? You could always have a -compile-anyway command-line flag that tells the code generator to do its best, for users that want to proceed with the unsupported feature. Thanks again, John Clements
Hi John,> If I understand you correctly, one interim measure would be to update > the code generators that don't support unwind to explicitly signal an > error, no? You could always have a -compile-anyway command-line flag > that tells the code generator to do its best, for users that want to > proceed with the unsupported feature.I agree that quietly producing wrong code is bad. If Chris agrees, I'll teach the code generator to abort if it encounters an "unwind". This seems a particularly good idea given how often this comes up :) Ciao, Duncan.
On Jan 29, 2009, at 12:15 AM, Duncan Sands wrote:> Hi John, > >> If I understand you correctly, one interim measure would be to update >> the code generators that don't support unwind to explicitly signal an >> error, no? You could always have a -compile-anyway command-line flag >> that tells the code generator to do its best, for users that want to >> proceed with the unsupported feature. > > I agree that quietly producing wrong code is bad. If Chris agrees, > I'll teach the code generator to abort if it encounters an "unwind". > This seems a particularly good idea given how often this comes up :)Makes sense to me! -Chris