From b0a6688ca476a8b7a9f28b762bace09bf5a431f1 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 15 Jan 2018 11:07:47 +0100 Subject: llvm5: use MutableArrayRef for APFloat::convertToInteger In llvm 5, since commit 957caa243d9270df37a566aedae3f1244e7b62ef, the first parameter to APFloat::convertToInteger is MutableArrayRef. So handle that. Signed-off-by: Jiri Slaby --- lib/Core/Executor.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 8ba9cf81..24211453 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -2319,7 +2319,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { llvm::APFloat Arg(*fpWidthToSemantics(arg->getWidth()), arg->getAPValue()); uint64_t value = 0; bool isExact = true; - Arg.convertToInteger(&value, resultType, false, +#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0) + auto valueRef = makeMutableArrayRef(value); +#else + uint64_t *valueRef = &value; +#endif + Arg.convertToInteger(valueRef, resultType, false, llvm::APFloat::rmTowardZero, &isExact); bindLocal(ki, state, ConstantExpr::alloc(value, resultType)); break; @@ -2336,7 +2341,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { uint64_t value = 0; bool isExact = true; - Arg.convertToInteger(&value, resultType, true, +#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0) + auto valueRef = makeMutableArrayRef(value); +#else + uint64_t *valueRef = &value; +#endif + Arg.convertToInteger(valueRef, resultType, true, llvm::APFloat::rmTowardZero, &isExact); bindLocal(ki, state, ConstantExpr::alloc(value, resultType)); break; -- cgit 1.4.1