diff options
author | Fangrui Song <i@maskray.me> | 2024-07-04 22:56:03 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-07-04 22:56:03 -0700 |
commit | 1d4d92d1cc98f22259aded4c3f29c67e7686ee30 (patch) | |
tree | 6d501eb4ad2f17bc8113914b8075a1f3192b0f9b /llvm/lib/MC/MachObjectWriter.cpp | |
parent | d2dd4b55e67e333d9253abeeacac5d3de1a094db (diff) | |
download | llvm-1d4d92d1cc98f22259aded4c3f29c67e7686ee30.zip llvm-1d4d92d1cc98f22259aded4c3f29c67e7686ee30.tar.gz llvm-1d4d92d1cc98f22259aded4c3f29c67e7686ee30.tar.bz2 |
[MC] Move MCAssembler::IndirectSymbols to MachObjectWriter
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/MachObjectWriter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index f5fae80..acacee2 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -47,6 +47,7 @@ using namespace llvm; void MachObjectWriter::reset() { Relocations.clear(); IndirectSymBase.clear(); + IndirectSymbols.clear(); SectionAddress.clear(); SectionOrder.clear(); StringTable.clear(); @@ -516,7 +517,7 @@ void MachObjectWriter::bindIndirectSymbols(MCAssembler &Asm) { // Report errors for use of .indirect_symbol not in a symbol pointer section // or stub section. - for (IndirectSymbolData &ISD : Asm.getIndirectSymbols()) { + for (IndirectSymbolData &ISD : IndirectSymbols) { const MCSectionMachO &Section = cast<MCSectionMachO>(*ISD.Section); if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && @@ -530,7 +531,7 @@ void MachObjectWriter::bindIndirectSymbols(MCAssembler &Asm) { } // Bind non-lazy symbol pointers first. - for (auto [IndirectIndex, ISD] : enumerate(Asm.getIndirectSymbols())) { + for (auto [IndirectIndex, ISD] : enumerate(IndirectSymbols)) { const auto &Section = cast<MCSectionMachO>(*ISD.Section); if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && @@ -544,7 +545,7 @@ void MachObjectWriter::bindIndirectSymbols(MCAssembler &Asm) { } // Then lazy symbol pointers and symbol stubs. - for (auto [IndirectIndex, ISD] : enumerate(Asm.getIndirectSymbols())) { + for (auto [IndirectIndex, ISD] : enumerate(IndirectSymbols)) { const auto &Section = cast<MCSectionMachO>(*ISD.Section); if (Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && @@ -970,7 +971,7 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm) { unsigned NumExternalSymbols = ExternalSymbolData.size(); unsigned FirstUndefinedSymbol = FirstExternalSymbol + NumExternalSymbols; unsigned NumUndefinedSymbols = UndefinedSymbolData.size(); - unsigned NumIndirectSymbols = Asm.getIndirectSymbols().size(); + unsigned NumIndirectSymbols = IndirectSymbols.size(); unsigned NumSymTabSymbols = NumLocalSymbols + NumExternalSymbols + NumUndefinedSymbols; uint64_t IndirectSymbolSize = NumIndirectSymbols * 4; @@ -1060,7 +1061,7 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm) { // Write the symbol table data, if used. if (NumSymbols) { // Write the indirect symbol entries. - for (auto &ISD : Asm.getIndirectSymbols()) { + for (auto &ISD : IndirectSymbols) { // Indirect symbols in the non-lazy symbol pointer section have some // special handling. const MCSectionMachO &Section = |