[LLVMdev] Compiler error: LoopStrengthReduce.cpp

Dale Johannesen dalej at apple.com
Thu May 14 09:48:57 PDT 2009


On May 12, 2009, at 10:59 PMPDT, OvermindDL1 wrote:
>>>>> The error given:
>>>>>
>>>>> ..\..\..\..\trunk\lib\Transforms\Scalar
>>>>> \LoopStrengthReduce.cpp(1016) :
>>>>> error C2668: 'abs' : ambiguous call to overloaded function
>>>>>
>> I checked in a fix.
>
> Also, IndVarSimplify.cpp has the same problem, only one abs usage in
> it, line 700:
>  if (Max.getZExtValue() > static_cast<uint64_t>(abs(intEV - intIV)))
> Following your style change:
>  if (Max.getZExtValue() > static_cast<uint64_t>(abs64(intEV - intIV)))

Fixed, thanks.

> Also, why make an abs64, why not just override abs with 64 bit  
> parameters?

Because I think overloading standard functions is evil.  ymmv.




More information about the llvm-dev mailing list