From 16ca2b991b07c85237e53e8b0c97f30c4cbc6e3d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 17 Sep 2002 23:56:50 +0000 Subject: [PATCH] Fix ambiguity problem due to builtin log2(double) function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3800 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/Support/MathExtras.h | 2 +- include/llvm/Support/MathExtras.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Support/MathExtras.h b/include/Support/MathExtras.h index bd5692b3ddb..d9076580b7e 100644 --- a/include/Support/MathExtras.h +++ b/include/Support/MathExtras.h @@ -19,7 +19,7 @@ inline unsigned log2(uint64_t C) { inline bool isPowerOf2(int64_t C, unsigned &getPow) { if (C < 0) C = -C; if (C > 0 && C == (C & ~(C - 1))) { - getPow = log2(C); + getPow = log2((uint64_t)C); return true; } diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index bd5692b3ddb..d9076580b7e 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -19,7 +19,7 @@ inline unsigned log2(uint64_t C) { inline bool isPowerOf2(int64_t C, unsigned &getPow) { if (C < 0) C = -C; if (C > 0 && C == (C & ~(C - 1))) { - getPow = log2(C); + getPow = log2((uint64_t)C); return true; }