[llvm-commits] [PATCH] Revised LandingPadInst Patch

Bill Wendling wendling at apple.com
Fri Aug 12 13:39:13 PDT 2011


On Aug 12, 2011, at 1:30 PM, Chris Lattner wrote:

> On Aug 12, 2011, at 1:27 PM, Bill Wendling wrote:
> 
>>> 
>>> Since there are only two clause types, it seems much more convenient to have "addFilter" and "addCatch" methods.  Likewise, instead of getClause() have isFilter(...)/isCatch(..) methods.  Providing the Enum APIs in addition to these is fine of course.
>>> 
>>> Instead of "getClause" returning the value by-reference, please have it return the Value* and require the client to use isCatch/isFilter.
>>> 
>> I made these changes. I actually kept the "getClause" method because both "getCatch" and "getFilter" were identical.
> 
> Keeping getClause() is fine, but make it return the clause!  (the value*)
> 
Aye. That it does. :)

>> Perhaps we should encode the clause type into the OperandList? Maybe something like:
>> 
>> void addCatch(Value *Val) {
>> // Grow OperandList if needed.
>> OperandList[n  ] = ConstantInt::get(LandingPadInst::Catch);
>> OperandList[n+1] = Val;
>> }
>> 
>> What do you think?
> 
> I don't see how it would add value.
> 
It would be useful if in the future we wanted to add more clause types to the LandingPadInst.

-bw




More information about the llvm-commits mailing list