Simplify another function that doesn't fail.

llvm-svn: 238703
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index ad6c6ae..4e1e179 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -387,8 +387,7 @@
     uint32_t Flags = I->getFlags();
     if (Flags & SymbolRef::SF_Common) {
       // Add the common symbols to a list.  We'll allocate them all below.
-      uint64_t Size = 0;
-      Check(I->getSize(Size));
+      uint64_t Size = I->getSize();
       CommonSize += Size;
     }
   }
@@ -495,8 +494,7 @@
     }
 
     uint32_t Align = Sym.getAlignment();
-    uint64_t Size = 0;
-    Check(Sym.getSize(Size));
+    uint64_t Size = Sym.getSize();
 
     CommonSize += Align + Size;
     SymbolsToAllocate.push_back(Sym);
@@ -518,9 +516,8 @@
   // Assign the address of each symbol
   for (auto &Sym : SymbolsToAllocate) {
     uint32_t Align = Sym.getAlignment();
-    uint64_t Size;
     StringRef Name;
-    Check(Sym.getSize(Size));
+    uint64_t Size = Sym.getSize();
     Check(Sym.getName(Name));
     if (Align) {
       // This symbol has an alignment requirement.
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 74709c8..96c7fae 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -236,16 +236,12 @@
   return Result;
 }
 
-std::error_code COFFObjectFile::getSymbolSize(DataRefImpl Ref,
-                                              uint64_t &Result) const {
+uint64_t COFFObjectFile::getSymbolSize(DataRefImpl Ref) const {
   COFFSymbolRef Symb = getCOFFSymbol(Ref);
 
   if (Symb.isCommon())
-    Result = Symb.getValue();
-  else
-    Result = UnknownAddressOrSize;
-
-  return object_error::success;
+    return Symb.getValue();
+  return UnknownAddressOrSize;
 }
 
 std::error_code
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index cae5b79..e1ace49 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -410,16 +410,13 @@
   return 0;
 }
 
-std::error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
-                                               uint64_t &Result) const {
+uint64_t MachOObjectFile::getSymbolSize(DataRefImpl DRI) const {
   uint64_t Value;
   getSymbolAddress(DRI, Value);
   uint32_t flags = getSymbolFlags(DRI);
   if (flags & SymbolRef::SF_Common)
-    Result = Value;
-  else
-    Result = UnknownAddressOrSize;
-  return object_error::success;
+    return Value;
+  return UnknownAddressOrSize;
 }
 
 std::error_code MachOObjectFile::getSymbolType(DataRefImpl Symb,
diff --git a/llvm/lib/Object/Object.cpp b/llvm/lib/Object/Object.cpp
index 84a5df0..67e5024 100644
--- a/llvm/lib/Object/Object.cpp
+++ b/llvm/lib/Object/Object.cpp
@@ -187,10 +187,7 @@
 }
 
 uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI) {
-  uint64_t ret;
-  if (std::error_code ec = (*unwrap(SI))->getSize(ret))
-    report_fatal_error(ec.message());
-  return ret;
+  return (*unwrap(SI))->getSize();
 }
 
 // RelocationRef accessors
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp
index 2efee5a..2943dd3 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp
@@ -31,7 +31,7 @@
 
     StringRef SymName; SymI->getName(SymName);
     uint64_t  SymAddr; SymI->getAddress(SymAddr);
-    uint64_t  SymSize; SymI->getSize(SymSize);
+    uint64_t SymSize = SymI->getSize();
     int64_t  Addend;  getELFRelocationAddend(Rel, Addend);
 
     MCSymbol *Sym = Ctx.getOrCreateSymbol(SymName);