Explicitly convert to double to suppress Visual C++ 2008 build error C2668 pow is...
authorZhongxing Xu <xuzhongxing@gmail.com>
Thu, 29 Oct 2009 03:43:06 +0000 (03:43 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Thu, 29 Oct 2009 03:43:06 +0000 (03:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85478 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryBuiltins.cpp

index 0982345cfa9fb23b216971d12c3e47cc217dcfc2..707a9ee77d2930642ceada06d5894574f33a0562 100644 (file)
@@ -159,7 +159,7 @@ static Value* isArrayMallocHelper(const CallInst *CI, LLVMContext &Context,
       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;