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/RaiseAsm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Module/RaiseAsm.cpp') diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp index e612ca63..af92b74b 100644 --- a/lib/Module/RaiseAsm.cpp +++ b/lib/Module/RaiseAsm.cpp @@ -115,7 +115,7 @@ bool RaiseAsmPass::runOnModule(Module &M) { for (Module::iterator fi = M.begin(), fe = M.end(); fi != fe; ++fi) { for (Function::iterator bi = fi->begin(), be = fi->end(); bi != be; ++bi) { for (BasicBlock::iterator ii = bi->begin(), ie = bi->end(); ii != ie;) { - Instruction *i = ii; + Instruction *i = static_cast(ii); ++ii; changed |= runOnInstruction(M, i); } -- cgit 1.4.1