MC: Use MCSymbol in MCObjectWriter::isWeak(), NFC
Continue to prefer `MCSymbol` when we need both.
llvm-svn: 237798
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 30aa1bd..c36da56 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -250,7 +250,7 @@
bool InSet,
bool IsPCRel) const override;
- bool isWeak(const MCSymbolData &SD) const override;
+ bool isWeak(const MCSymbol &Sym) const override;
void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout) override;
void writeSection(MCAssembler &Asm,
@@ -1478,7 +1478,8 @@
InSet, IsPCRel);
}
-bool ELFObjectWriter::isWeak(const MCSymbolData &SD) const {
+bool ELFObjectWriter::isWeak(const MCSymbol &Sym) const {
+ const MCSymbolData &SD = Sym.getData();
if (::isWeak(SD))
return true;
@@ -1491,7 +1492,6 @@
if (MCELF::GetBinding(SD) != ELF::STB_GLOBAL)
return false;
- const MCSymbol &Sym = SD.getSymbol();
if (!Sym.isInSection())
return false;