[LLVMdev] RFC: New Exception Handling Proposal

Bill Wendling wendling at apple.com
Tue Nov 24 13:10:59 PST 2009


On Nov 24, 2009, at 2:15 AM, Jay Foad wrote:

>> Well, be warned that there can be multiple convokes which jump to  
>> the same
>> landing pads. So there cannot be a one-to-one correspondence  
>> between them.
>> However, an llvm.eh.exception should be dominated by at least one  
>> convoke.
>> The only other problem I can see is if code branches into a catch  
>> block.
>> It's gross, but could happen. In that case, the llvm.eh.exception  
>> should
>> *not* be executed, because it's metadata constructed by the  
>> compiler, not
>> user code. It would have to be peeled out into its own basic block  
>> in such
>> instances.
>
> Are you saying that, in the LLVM IR, it would be legal to have an
> llvm.eh.exception that *isn't* dominated by convokes (because there's
> a direct branch to that catch block), and in that case the call
> returns an undefined value?

No. The opposite of that.

> And it would be up to codegen to "peel it out into its own basic  
> block"?
>

The front-end should be able to take care of this.

-bw




More information about the llvm-dev mailing list