about summary refs log tree commit diff homepage
path: root/lib/Module/Checks.cpp
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2017-02-23 17:41:33 +0100
committerJiri Slaby <jirislaby@gmail.com>2017-02-28 18:28:06 +0100
commitb7a6aec4eeb4cbbc71d4747d2aa6d25dda41d5d1 (patch)
treee49d673744e699506506cbe0a3dc29c215170877 /lib/Module/Checks.cpp
parente21bf6f653b9c602fe21b74ff7c389aa2430b386 (diff)
downloadklee-b7a6aec4eeb4cbbc71d4747d2aa6d25dda41d5d1.tar.gz
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<llvm::Function>') to 'llvm::Function *'
    Function *f = i;
              ^   ~

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Diffstat (limited to 'lib/Module/Checks.cpp')
-rw-r--r--lib/Module/Checks.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Module/Checks.cpp b/lib/Module/Checks.cpp
index 44b35e6e..48a4eb94 100644
--- a/lib/Module/Checks.cpp
+++ b/lib/Module/Checks.cpp
@@ -71,7 +71,7 @@ bool DivCheckPass::runOnModule(Module &M) {
                                           Type::getInt64Ty(ctx),
                                           false,  /* sign doesn't matter */
                                           "int_cast_to_i64",
-                                          i);
+                                          static_cast<Instruction *>(i));
             
             // Lazily bind the function to avoid always importing it.
             if (!divZeroCheckFunction) {
@@ -129,7 +129,7 @@ bool OvershiftCheckPass::runOnModule(Module &M) {
                                           Type::getInt64Ty(ctx),
                                           false,  /* sign doesn't matter */
                                           "int_cast_to_i64",
-                                          i);
+                                          static_cast<Instruction *>(i));
             args.push_back(shift);