From a0971b7c4be552e2664c6432887d0708db70006f Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Mon, 24 Dec 2012 02:04:18 +0100 Subject: [PATCH] Use more portable integer log from LLVM. --- gen/passes/GarbageCollect2Stack.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index 0f08cbc7..acc26a21 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -46,6 +46,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtra.h" #include "llvm/Support/raw_ostream.h" #include @@ -179,7 +180,7 @@ namespace { if (SizeLimit > 0) { uint64_t ElemSize = A.TD.getTypeAllocSize(Ty); - unsigned BitsLimit = static_cast(log2(SizeLimit / ElemSize)); + unsigned BitsLimit = Log2_64(SizeLimit / ElemSize)); // LLVM's alloca ueses an i32 for the number of elements. BitsLimit = std::min(BitsLimit, 32U);