From: David Majnemer Date: Sat, 7 Mar 2015 20:56:50 +0000 (+0000) Subject: Fix unused variable/function warnings X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0e7a2ca4b815080f2c1a5b01be31aa16cf212932;p=oota-llvm.git Fix unused variable/function warnings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231576 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp index 4791f8776bd..56bcb8ee674 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp @@ -60,7 +60,7 @@ RuntimeDyldCOFF::loadObject(const object::ObjectFile &O) { uint64_t RuntimeDyldCOFF::getSymbolOffset(const SymbolRef &Sym) { uint64_t Address; - if (std::error_code EC = Sym.getAddress(Address)) + if (Sym.getAddress(Address)) return UnknownAddressOrSize; if (Address == UnknownAddressOrSize) @@ -68,7 +68,7 @@ uint64_t RuntimeDyldCOFF::getSymbolOffset(const SymbolRef &Sym) { const ObjectFile *Obj = Sym.getObject(); section_iterator SecI(Obj->section_end()); - if (std::error_code EC = Sym.getSection(SecI)) + if (Sym.getSection(SecI)) return UnknownAddressOrSize; if (SecI == Obj->section_end()) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index 210ee47eb74..20c63f171a9 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -36,15 +36,13 @@ using namespace llvm::object; namespace llvm { -namespace { // Helper for extensive error checking in debug builds. - std::error_code Check(std::error_code Err) { - if (Err) { - report_fatal_error(Err.message()); - } - return Err; +inline std::error_code Check(std::error_code Err) { + if (Err) { + report_fatal_error(Err.message()); } -} // end anonymous namespace + return Err; +} class Twine; diff --git a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.cpp b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.cpp index 342eb136494..9ea628a258e 100644 --- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.cpp @@ -118,7 +118,6 @@ relocation_iterator RuntimeDyldCOFFX86_64::processRelocationRef( report_fatal_error("Unknown symbol in relocation"); unsigned TargetSectionID = 0; uint64_t TargetOffset = UnknownAddressOrSize; - const COFFObjectFile *COFFObj = cast(&Obj); section_iterator SecI(Obj.section_end()); Symbol->getSection(SecI); if (SecI == Obj.section_end())