From a4d22472f35195e04f39caa3a42b0141ed49a4f1 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 31 May 2015 23:52:50 +0000 Subject: Simplify interface of function that doesn't fail. llvm-svn: 238700 --- llvm/lib/Object/MachOObjectFile.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 439dceb323b..cae5b799ac1 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -401,16 +401,13 @@ std::error_code MachOObjectFile::getSymbolAddress(DataRefImpl Symb, return object_error::success; } -std::error_code MachOObjectFile::getSymbolAlignment(DataRefImpl DRI, - uint32_t &Result) const { +uint32_t MachOObjectFile::getSymbolAlignment(DataRefImpl DRI) const { uint32_t flags = getSymbolFlags(DRI); if (flags & SymbolRef::SF_Common) { MachO::nlist_base Entry = getSymbolTableEntryBase(this, DRI); - Result = 1 << MachO::GET_COMM_ALIGN(Entry.n_desc); - } else { - Result = 0; + return 1 << MachO::GET_COMM_ALIGN(Entry.n_desc); } - return object_error::success; + return 0; } std::error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI, -- cgit v1.2.3