diff options
author | Fangrui Song <i@maskray.me> | 2025-06-29 16:12:10 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2025-06-29 16:12:10 -0700 |
commit | cd075a40133dbe8a01f4fb1d6b99d55869089edf (patch) | |
tree | ff8abb11cb59879abca8482e327332e5c5b77bdd /llvm/lib/MC/MCMachOStreamer.cpp | |
parent | 38df9ebdc6dbfb7ffacb0a3236137bd1819a2f45 (diff) | |
download | llvm-cd075a40133dbe8a01f4fb1d6b99d55869089edf.zip llvm-cd075a40133dbe8a01f4fb1d6b99d55869089edf.tar.gz llvm-cd075a40133dbe8a01f4fb1d6b99d55869089edf.tar.bz2 |
MCObjectStreamer: Deduplicate emitInstToData
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCMachOStreamer.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp index 4cf602b..e1d7f8c 100644 --- a/llvm/lib/MC/MCMachOStreamer.cpp +++ b/llvm/lib/MC/MCMachOStreamer.cpp @@ -59,8 +59,6 @@ private: /// labels in the middle of the section. DenseMap<const MCSection*, bool> HasSectionLabel; - void emitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override; - void emitDataRegion(MachO::DataRegionType Kind); void emitDataRegionEnd(); @@ -423,23 +421,6 @@ void MCMachOStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, emitZerofill(Section, Symbol, Size, ByteAlignment); } -void MCMachOStreamer::emitInstToData(const MCInst &Inst, - const MCSubtargetInfo &STI) { - MCDataFragment *DF = getOrCreateDataFragment(); - - SmallVector<MCFixup, 4> Fixups; - SmallString<256> Code; - getAssembler().getEmitter().encodeInstruction(Inst, Code, Fixups, STI); - - // Add the fixups and data. - for (MCFixup &Fixup : Fixups) { - Fixup.setOffset(Fixup.getOffset() + DF->getContents().size()); - DF->getFixups().push_back(Fixup); - } - DF->setHasInstructions(STI); - DF->appendContents(Code); -} - void MCMachOStreamer::finishImpl() { emitFrames(&getAssembler().getBackend()); |