[llvm-commits] [llvm] r85478 - /llvm/trunk/lib/Analysis/MemoryBuiltins.cpp

Chris Lattner clattner at apple.com
Wed Oct 28 20:54:02 PDT 2009


On Oct 28, 2009, at 8:43 PM, Zhongxing Xu wrote:

> Author: zhongxingxu
> Date: Wed Oct 28 22:43:06 2009
> New Revision: 85478
>
> URL: http://llvm.org/viewvc/llvm-project?rev=85478&view=rev
> Log:
> Explicitly convert to double to suppress Visual C++ 2008 build error  
> C2668 pow is ambiguous call to overloaded function

Hi Zhongxing,

Please make sure this fits in 80 columns, you can also use "2.0"  
instead of a cast.

-Chris

>
> Modified:
>    llvm/trunk/lib/Analysis/MemoryBuiltins.cpp
>
> Modified: llvm/trunk/lib/Analysis/MemoryBuiltins.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryBuiltins.cpp?rev=85478&r1=85477&r2=85478&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Analysis/MemoryBuiltins.cpp (original)
> +++ llvm/trunk/lib/Analysis/MemoryBuiltins.cpp Wed Oct 28 22:43:06  
> 2009
> @@ -159,7 +159,7 @@
>       ConstantInt* Op1Int = dyn_cast<ConstantInt>(Op1);
>       if (!Op1Int) return NULL;
>       Value* Op1Pow = ConstantInt::get(Op1->getType(),
> -                                       pow(2, Op1Int->getZExtValue 
> ()));
> +                                       pow((double) 2, (double)  
> Op1Int->getZExtValue()));
>       if (Op0 == ElementSize || (FoldedElementSize && Op0 ==  
> FoldedElementSize))
>         // ArraySize << log2(ElementSize)
>         return Op1Pow;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list