- bool IsELF = MOFI && MOFI->getObjectFileType() == MCObjectFileInfo::IsELF;
- if (IsELF)
- return new (*this) MCSymbolELF(Name, IsTemporary);
- return new (*this) MCSymbol(false, Name, IsTemporary);
+ if (MOFI) {
+ switch (MOFI->getObjectFileType()) {
+ case MCObjectFileInfo::IsCOFF:
+ return new (Name, *this) MCSymbolCOFF(Name, IsTemporary);
+ case MCObjectFileInfo::IsELF:
+ return new (Name, *this) MCSymbolELF(Name, IsTemporary);
+ case MCObjectFileInfo::IsMachO:
+ return new (Name, *this) MCSymbolMachO(Name, IsTemporary);
+ }
+ }
+ return new (Name, *this) MCSymbol(MCSymbol::SymbolKindUnset, Name,
+ IsTemporary);