mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 20:29:30 +00:00
MC: Use MCSymbol in MCObjectWriter::isWeak(), NFC
Continue to prefer `MCSymbol` when we need both. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8ca7ac2a38
commit
f5bdf04f09
@ -101,7 +101,7 @@ public:
|
||||
/// \brief True if this symbol (which is a variable) is weak. This is not
|
||||
/// just STB_WEAK, but more generally whether or not we can evaluate
|
||||
/// past it.
|
||||
virtual bool isWeak(const MCSymbolData &SD) const;
|
||||
virtual bool isWeak(const MCSymbol &Sym) const;
|
||||
|
||||
/// \brief Write the object file.
|
||||
///
|
||||
|
@ -250,7 +250,7 @@ class ELFObjectWriter : public MCObjectWriter {
|
||||
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 @@ bool ELFObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(
|
||||
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 @@ bool ELFObjectWriter::isWeak(const MCSymbolData &SD) const {
|
||||
if (MCELF::GetBinding(SD) != ELF::STB_GLOBAL)
|
||||
return false;
|
||||
|
||||
const MCSymbol &Sym = SD.getSymbol();
|
||||
if (!Sym.isInSection())
|
||||
return false;
|
||||
|
||||
|
@ -608,8 +608,7 @@ static bool canExpand(const MCSymbol &Sym, const MCAssembler *Asm, bool InSet) {
|
||||
return true;
|
||||
if (!Asm)
|
||||
return false;
|
||||
const MCSymbolData &SD = Asm->getSymbolData(Sym);
|
||||
return !Asm->getWriter().isWeak(SD);
|
||||
return !Asm->getWriter().isWeak(Sym);
|
||||
}
|
||||
|
||||
bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
|
||||
|
@ -48,4 +48,4 @@ bool MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(
|
||||
return &SecA == &SecB;
|
||||
}
|
||||
|
||||
bool MCObjectWriter::isWeak(const MCSymbolData &SD) const { return false; }
|
||||
bool MCObjectWriter::isWeak(const MCSymbol &) const { return false; }
|
||||
|
@ -175,7 +175,7 @@ public:
|
||||
const MCFragment &FB, bool InSet,
|
||||
bool IsPCRel) const override;
|
||||
|
||||
bool isWeak(const MCSymbolData &SD) const override;
|
||||
bool isWeak(const MCSymbol &Sym) const override;
|
||||
|
||||
void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout,
|
||||
const MCFragment *Fragment, const MCFixup &Fixup,
|
||||
@ -661,11 +661,11 @@ bool WinCOFFObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(
|
||||
InSet, IsPCRel);
|
||||
}
|
||||
|
||||
bool WinCOFFObjectWriter::isWeak(const MCSymbolData &SD) const {
|
||||
bool WinCOFFObjectWriter::isWeak(const MCSymbol &Sym) const {
|
||||
const MCSymbolData &SD = Sym.getData();
|
||||
if (!SD.isExternal())
|
||||
return false;
|
||||
|
||||
const MCSymbol &Sym = SD.getSymbol();
|
||||
if (!Sym.isInSection())
|
||||
return false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user