From 46b144492c54a14004b0a982948610ff47f72743 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 15 Jan 2018 10:24:48 +0100 Subject: llvm50: use auto variable instead of SwitchInst::CaseIt llvm50 changed the semantics of SwitchInst::CaseIt and started using "auto" variable type. So use it here too for all versions greater than 3.4 -- 3.4 does not support this semantics yet. Signed-off-by: Jiri Slaby --- lib/Core/Executor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Core') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index be92b16a..fe53fc9b 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -1553,8 +1553,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { std::map, BasicBlock *> expressionOrder; // Iterate through all non-default cases and order them by expressions +#if LLVM_VERSION_CODE > LLVM_VERSION(3, 4) + for (auto i : si->cases()) { +#else for (SwitchInst::CaseIt i = si->case_begin(), e = si->case_end(); i != e; ++i) { +#endif ref value = evalConstant(i.getCaseValue()); BasicBlock *caseSuccessor = i.getCaseSuccessor(); -- cgit 1.4.1