about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2018-01-15 11:07:47 +0100
committerMartinNowack <martin.nowack@gmail.com>2018-10-26 13:31:07 +0100
commitb0a6688ca476a8b7a9f28b762bace09bf5a431f1 (patch)
treeab1b174500d982efa73c0a1f7c2f25c5a8ec14a7 /lib
parent85b2324dd54e63c49ce4936e6b6b0d4d6535fc05 (diff)
downloadklee-b0a6688ca476a8b7a9f28b762bace09bf5a431f1.tar.gz
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 <jirislaby@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/Executor.cpp14
1 files 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;