[llvm-commits] Workaround for PR1508

Chris Lattner clattner at apple.com
Wed Jun 13 22:58:57 PDT 2007


On Jun 13, 2007, at 10:51 PM, Duncan Sands wrote:

> Hi Chris,
>
>> +  // Inform the MachineModuleInfo of the personality for this
>> landing pad.
>> +  ConstantExpr *CE = dyn_cast<ConstantExpr>(I.getOperand(2));
>> +  assert(CE && CE->getOpcode() == Instruction::BitCast &&
>>
>> Please just use cast<> instead of dyn_cast, which guarantees no null
>> return.
>
> but then you don't get the helpful assertion message.

Sure, but in release builds, you pay a cost :)

-Chris



More information about the llvm-commits mailing list