[llvm-commits] [Patch] Exception Handling Documentation

David Blaikie dblaikie at gmail.com
Tue Aug 2 14:49:34 PDT 2011


>>> +  <li>A landing pad blcok must have a '<tt>landingpad</tt>' instruction as its
>>> +      first non-PHI instruction.</li>
>>> +  <li>The '<tt>landingpad</tt>' instruction must be the first non-PHI
>>> +      instruction in the landing pad block.</li>
>>>
>>> typo "blcok".  It's not clear to me what the difference between these two points is.
>>>
>> The second is restricting the placement of the landingpad instruction. The first is restricting how the landing pad block is set up. It would prevent this, admittedly broken, landing pad block:

I for one kind of liked the original phrasing compared to the
alternative below - though I had the same double take when I read it
"wait, what's it saying - oh, I see" kind of moment. Perhaps:

>> lpad:
>>  %exn = landingpad ...
>>  %exn1 = landingpad ...
>>
>> Though this may be overkill?
>>
> How about these for the restrictions?
>
>        • A landing pad block is a basic block which is the unwind destination of an 'invoke' instruction.
>        • A landing pad block must have a 'landingpad' instruction as its first non-PHI instruction.
>        • There can be only one 'landingpad' instruction within the landing pad block.
>        • A basic block that is not a landing pad block may not include a 'landingpad' instruction.
>        • All 'landingpad' instructions in a function must have the same personality function.


How about: "A landing pad instruction must (and may only) be the first
non-PHI instruction in a landing pad block"

This covers 2, 3, and 4 in one sentence, if I'm not mistaken. (& seems
clearer to me)

- David




More information about the llvm-commits mailing list