diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-08 23:35:49 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-08 23:35:49 +0000 |
| commit | 36003057ac44a61cf3e3b98b904ddc73c1b1ea74 (patch) | |
| tree | 24b30652768e2e5bdb99fb4c1ceb363a7f7fec8a /llvm/lib/MC/ELFObjectWriter.cpp | |
| parent | dd8fd9dcfdc244184a591c0f2d2c034857641c9f (diff) | |
| download | bcm5719-llvm-36003057ac44a61cf3e3b98b904ddc73c1b1ea74.tar.gz bcm5719-llvm-36003057ac44a61cf3e3b98b904ddc73c1b1ea74.zip | |
MC: Remove unused virtual function MCObjectWriter::isWeak. NFC.
llvm-svn: 299817
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
| -rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index b6f21ba26b6..ee9c25cda94 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -248,8 +248,6 @@ public: const MCFragment &FB, bool InSet, bool IsPCRel) const override; - bool isWeak(const MCSymbol &Sym) const override; - void writeObject(MCAssembler &Asm, const MCAsmLayout &Layout) override; void writeSection(const SectionIndexMapTy &SectionIndexMap, uint32_t GroupSymbolIndex, uint64_t Offset, uint64_t Size, @@ -1359,34 +1357,13 @@ bool ELFObjectWriter::isSymbolRefDifferenceFullyResolvedImpl( const auto &SymA = cast<MCSymbolELF>(SA); if (IsPCRel) { assert(!InSet); - if (::isWeak(SymA)) + if (isWeak(SymA)) return false; } return MCObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(Asm, SymA, FB, InSet, IsPCRel); } -bool ELFObjectWriter::isWeak(const MCSymbol &S) const { - const auto &Sym = cast<MCSymbolELF>(S); - if (::isWeak(Sym)) - return true; - - // It is invalid to replace a reference to a global in a comdat - // with a reference to a local since out of comdat references - // to a local are forbidden. - // We could try to return false for more cases, like the reference - // being in the same comdat or Sym being an alias to another global, - // but it is not clear if it is worth the effort. - if (Sym.getBinding() != ELF::STB_GLOBAL) - return false; - - if (!Sym.isInSection()) - return false; - - const auto &Sec = cast<MCSectionELF>(Sym.getSection()); - return Sec.getGroup(); -} - MCObjectWriter *llvm::createELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_pwrite_stream &OS, bool IsLittleEndian) { |

