Simplify getSymbolFlags.
None of the object formats require extra parsing to compute these flags,
so the method cannot fail.
llvm-svn: 200574
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 43321c4..78cf1ab6 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -155,10 +155,9 @@
return object_error::success;
}
-error_code COFFObjectFile::getSymbolFlags(DataRefImpl Ref,
- uint32_t &Result) const {
+uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const {
const coff_symbol *Symb = toSymb(Ref);
- Result = SymbolRef::SF_None;
+ uint32_t Result = SymbolRef::SF_None;
// TODO: Correctly set SF_FormatSpecific, SF_ThreadLocal, SF_Common
@@ -176,7 +175,7 @@
if (Symb->SectionNumber == COFF::IMAGE_SYM_ABSOLUTE)
Result |= SymbolRef::SF_Absolute;
- return object_error::success;
+ return Result;
}
error_code COFFObjectFile::getSymbolSize(DataRefImpl Ref,