klee/0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch

50 lines
1.8 KiB
Diff

From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 11:07:47 +0100
Subject: llvm50: use MutableArrayRef for APFloat::convertToInteger
Patch-mainline: no
in llvm 5, since commit 957caa243d9270df37a566aedae3f1244e7b62ef, the
first parameter to APFloat::convertToInteger is MutableArrayRef. So
handle that.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
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 5fe5bf9c1346..44293f885136 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -2219,7 +2219,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)
+ MutableArrayRef<uint64_t> 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;
@@ -2236,7 +2241,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)
+ MutableArrayRef<uint64_t> 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;
--
2.15.1