aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/WinCOFFObjectWriter.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-06-08 17:17:19 +0000
committerPete Cooper <peter_cooper@apple.com>2015-06-08 17:17:19 +0000
commit6bf1f3008c46135f03fa4b7d0b473161f8ed68fc (patch)
tree0dd3d198ba66bcc62c236f3a55c2a32af57e6328 /llvm/lib/MC/WinCOFFObjectWriter.cpp
parent0854f93021761f0e161537845c447f25e380ccd4 (diff)
downloadllvm-6bf1f3008c46135f03fa4b7d0b473161f8ed68fc.zip
llvm-6bf1f3008c46135f03fa4b7d0b473161f8ed68fc.tar.gz
llvm-6bf1f3008c46135f03fa4b7d0b473161f8ed68fc.tar.bz2
Move all of the MCSymbol COFF flags logic in to MCSymbolCOFF.
All flags setting/getting is now done in the class with helper methods instead of users having to get the bits in the correct order. Reviewed by Rafael EspĂ­ndola. llvm-svn: 239314
Diffstat (limited to 'llvm/lib/MC/WinCOFFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WinCOFFObjectWriter.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index 3aabce6..423c7dc 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -228,7 +228,7 @@ bool COFFSymbol::should_keep() const {
}
// if this is a safeseh handler, keep it
- if (MC && (MC->getFlags() & COFF::SF_SafeSEH))
+ if (MC && (cast<MCSymbolCOFF>(MC)->isSafeSEH()))
return true;
// if the section its in is being droped, drop it
@@ -394,7 +394,7 @@ void WinCOFFObjectWriter::DefineSymbol(const MCSymbol &Symbol,
COFFSymbol *coff_symbol = GetOrCreateCOFFSymbol(&Symbol);
SymbolMap[&Symbol] = coff_symbol;
- if (Symbol.getFlags() & COFF::SF_WeakExternal) {
+ if (cast<MCSymbolCOFF>(Symbol).isWeakExternal()) {
coff_symbol->Data.StorageClass = COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL;
if (Symbol.isVariable()) {
@@ -430,8 +430,7 @@ void WinCOFFObjectWriter::DefineSymbol(const MCSymbol &Symbol,
const MCSymbolCOFF &SymbolCOFF = cast<MCSymbolCOFF>(Symbol);
coff_symbol->Data.Type = SymbolCOFF.getType();
- coff_symbol->Data.StorageClass =
- (Symbol.getFlags() & COFF::SF_ClassMask) >> COFF::SF_ClassShift;
+ coff_symbol->Data.StorageClass = SymbolCOFF.getClass();
// If no storage class was specified in the streamer, define it here.
if (coff_symbol->Data.StorageClass == COFF::IMAGE_SYM_CLASS_NULL) {