klee/0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch

40 lines
1.1 KiB
Diff
Raw Normal View History

From: Jiri Slaby <jirislaby@gmail.com>
Date: Wed, 7 Jun 2017 14:54:32 +0200
Subject: llvm: APFloat members are functions in LLVM 4.0
Patch-mainline: no
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Core/Executor.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index b2178cccefd2..75132e0db71b 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -1448,12 +1448,21 @@ static bool isDebugIntrinsic(const Function *f, KModule *KM) {
static inline const llvm::fltSemantics * fpWidthToSemantics(unsigned width) {
switch(width) {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
+ case Expr::Int32:
+ return &llvm::APFloat::IEEEsingle();
+ case Expr::Int64:
+ return &llvm::APFloat::IEEEdouble();
+ case Expr::Fl80:
+ return &llvm::APFloat::x87DoubleExtended();
+#else
case Expr::Int32:
return &llvm::APFloat::IEEEsingle;
case Expr::Int64:
return &llvm::APFloat::IEEEdouble;
case Expr::Fl80:
return &llvm::APFloat::x87DoubleExtended;
+#endif
default:
return 0;
}
--
2.17.0