From b7a6aec4eeb4cbbc71d4747d2aa6d25dda41d5d1 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 23 Feb 2017 17:41:33 +0100 Subject: convert iterators using static_cast Newer versions of LLVM do not allow to implicitly cast iterators to pointers where they point. So convert all such uses to explicit static_cast, the same as LLVM code does. Otherwise we see errors like: lib/Core/Executor.cpp:548:15: error: no viable conversion from 'Module::iterator' (aka 'ilist_iterator') to 'llvm::Function *' Function *f = i; ^ ~ Signed-off-by: Jiri Slaby --- lib/Module/LowerSwitch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Module/LowerSwitch.cpp') diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp index 7f28748a..5cc6b991 100644 --- a/lib/Module/LowerSwitch.cpp +++ b/lib/Module/LowerSwitch.cpp @@ -44,7 +44,8 @@ bool LowerSwitchPass::runOnFunction(Function &F) { bool changed = false; for (Function::iterator I = F.begin(), E = F.end(); I != E; ) { - BasicBlock *cur = I++; // Advance over block so we don't traverse new blocks + BasicBlock *cur = static_cast(I); + I++; // Advance over block so we don't traverse new blocks if (SwitchInst *SI = dyn_cast(cur->getTerminator())) { changed = true; -- cgit 1.4.1