about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2017-11-17 17:56:18 +0100
committerMartinNowack <martin.nowack@gmail.com>2018-09-18 10:36:36 +0100
commitabe23c4f145950c1d119ca3b62a9b04c9980558b (patch)
tree5bd6583b57514778cc1cb4751da3aba8cad8b69e /lib
parent06cf93da0c60a9a8f48c94db7fa1d8b2cc755eef (diff)
downloadklee-abe23c4f145950c1d119ca3b62a9b04c9980558b.tar.gz
llvm4: gep_type_iterator has no operator*
Starting with LLVM 4, we have getStructTypeOrNull(), so use it.
operator* in post-4 will have a different semantics.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/ExecutorUtil.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Core/ExecutorUtil.cpp b/lib/Core/ExecutorUtil.cpp
index a352db33..daea189a 100644
--- a/lib/Core/ExecutorUtil.cpp
+++ b/lib/Core/ExecutorUtil.cpp
@@ -213,7 +213,11 @@ namespace klee {
           continue;
 
         // Handle a struct index, which adds its field offset to the pointer.
+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
+        if (auto STy = ii.getStructTypeOrNull()) {
+#else
         if (StructType *STy = dyn_cast<StructType>(*ii)) {
+#endif
           unsigned ElementIdx = indexOp->getZExtValue();
           const StructLayout *SL = kmodule->targetData->getStructLayout(STy);
           base = base->Add(