From 6d0c409ce885a38979f3bcb8d73ebc8bacc0dcfa Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 28 Feb 2017 17:59:15 +0100 Subject: Module: simplify is_object checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit object::Binary has isObject method, which can be used to check whether it is an object::ObjectFile. Use that, since dyn_casting of object::Binary is not allowed in newer LLVMs: lib/Module/ModuleUtil.cpp:304:78: error: cannot convert ‘llvm::object::ObjectFile’ to ‘llvm::object::ObjectFile*’ in initialization else if (object::ObjectFile *o = dyn_cast(child.get())) ^ Signed-off-by: Jiri Slaby --- lib/Module/ModuleUtil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp index 94a37e08..83dc5045 100644 --- a/lib/Module/ModuleUtil.cpp +++ b/lib/Module/ModuleUtil.cpp @@ -266,9 +266,9 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er } } - else if (object::ObjectFile *o = dyn_cast(child.get())) + else if (child.get()->isObject()) { - SS << "Object file " << o->getFileName().data() << + SS << "Object file " << child.get()->getFileName().data() << " in archive is not supported"; SS.flush(); return false; @@ -412,10 +412,10 @@ Module *klee::linkWithLibrary(Module *module, } else if (magic.is_object()) { OwningPtr obj; - if (object::ObjectFile *o = dyn_cast(obj.get())) { + if (obj.get()->isObject()) { klee_warning("Link with library: Object file %s in archive %s found. " "Currently not supported.", - o->getFileName().data(), libraryName.c_str()); + obj.get()->getFileName().data(), libraryName.c_str()); } } else { klee_error("Link with library %s failed: Unrecognized file type.", -- cgit 1.4.1