aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-31 20:57:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-31 20:57:12 +0000
commit20122a436c31f61a0063f10759589ec0c73bac31 (patch)
treed406560fbb040d1553cbe5139f6a4b58ae2fd936 /llvm/lib/Object/COFFObjectFile.cpp
parent67294e253edd8cc39a6c66100b777a034d46761d (diff)
downloadllvm-20122a436c31f61a0063f10759589ec0c73bac31.zip
llvm-20122a436c31f61a0063f10759589ec0c73bac31.tar.gz
llvm-20122a436c31f61a0063f10759589ec0c73bac31.tar.bz2
Simplify getSymbolFlags.
None of the object formats require extra parsing to compute these flags, so the method cannot fail. llvm-svn: 200574
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp7
1 files changed, 3 insertions, 4 deletions
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 @@ error_code COFFObjectFile::getSymbolType(DataRefImpl Ref,
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 @@ error_code COFFObjectFile::getSymbolFlags(DataRefImpl Ref,
if (Symb->SectionNumber == COFF::IMAGE_SYM_ABSOLUTE)
Result |= SymbolRef::SF_Absolute;
- return object_error::success;
+ return Result;
}
error_code COFFObjectFile::getSymbolSize(DataRefImpl Ref,