Don't return error_code from function that never fails.
[oota-llvm.git] / tools / llvm-readobj / COFFDumper.cpp
index 0041c7ef6a9ecb80449730bc7d44c9d671a3ffe7..1b8bdbe2acee74c85021c7aa9a711976f1e13833 100644 (file)
@@ -121,9 +121,7 @@ std::error_code COFFDumper::resolveSymbol(const coff_section *Section,
                                           uint64_t Offset, SymbolRef &Sym) {
   const auto &Relocations = RelocMap[Section];
   for (const auto &Relocation : Relocations) {
-    uint64_t RelocationOffset;
-    if (std::error_code EC = Relocation.getOffset(RelocationOffset))
-      return EC;
+    uint64_t RelocationOffset = Relocation.getOffset();
 
     if (RelocationOffset == Offset) {
       Sym = *Relocation.getSymbol();
@@ -805,12 +803,10 @@ void COFFDumper::printRelocations() {
 
 void COFFDumper::printRelocation(const SectionRef &Section,
                                  const RelocationRef &Reloc) {
-  uint64_t Offset;
+  uint64_t Offset = Reloc.getOffset();
   uint64_t RelocType;
   SmallString<32> RelocName;
   StringRef SymbolName;
-  if (error(Reloc.getOffset(Offset)))
-    return;
   if (error(Reloc.getType(RelocType)))
     return;
   if (error(Reloc.getTypeName(RelocName)))