From abe23c4f145950c1d119ca3b62a9b04c9980558b Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Fri, 17 Nov 2017 17:56:18 +0100 Subject: 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 --- lib/Core/ExecutorUtil.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Core/ExecutorUtil.cpp') 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(*ii)) { +#endif unsigned ElementIdx = indexOp->getZExtValue(); const StructLayout *SL = kmodule->targetData->getStructLayout(STy); base = base->Add( -- cgit 1.4.1