[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner clattner at apple.com
Wed Dec 13 09:55:22 PST 2006


On Dec 13, 2006, at 9:20 AM, Reid Spencer wrote:

>>> +static Value *InsertCastToIntPtrTy(Value *V, const Type *DTy,
>>> +                                   Instruction *InsertPoint,
>>> +                                   InstCombiner *IC) {
>>
>> Why did you rename this?
>
> Because the name doesn't match its action. SExt is only one  
> possibility.
> The type of Value* can be larger, smaller, or equal in size to DTy  
> so it
> can be SExt, Trunc, or BitCast. I figured
> InsertSignExtendOrTruncateOrBitCastToPtrTy was a bit long.
>
>> The previous name was better (indicated
>> sign extension).
>
> The previous name is misleading. It doesn't always do a SExt.   
> Consider
> long GEP index on a 32-bit platform. The cast needed is a Trunc.
>

Ok.

-Chris



More information about the llvm-commits mailing list