[M68k] Factoring out memory operand printer into a separate file
authorMin-Yih Hsu <minyihh@uci.edu>
Tue, 7 Feb 2023 19:21:12 +0000 (11:21 -0800)
committerMin-Yih Hsu <minyihh@uci.edu>
Wed, 8 Mar 2023 21:51:53 +0000 (13:51 -0800)
commitaaa2503ad9629ffe5eb9b325bf867a89bd19a31e
tree134ff6b165d7afb05511ebae7ec27c87cf526548
parent7a4061ae372b3262703ffeea3b64db89187db611
[M68k] Factoring out memory operand printer into a separate file

In order to support inline asm with memory constraints,
AsmPrinter::PrintAsmMemOperand needs to be implemented, which has lots
of overlaps with MCInstPrinter especially on the format of complex
addressing modes. This patch factors out the common printing logics from
MCInstPrinter into a separate class inherited by both AsmPrinter and
MCInstPrinter, in which the derived classes only need to provide
primitives like printOperand and printDisp.

This change is basically NFC. See D143529 for changes on AsmPrinter.

Differential Revision: https://reviews.llvm.org/D143528
llvm/lib/Target/M68k/MCTargetDesc/M68kInstPrinter.cpp
llvm/lib/Target/M68k/MCTargetDesc/M68kInstPrinter.h
llvm/lib/Target/M68k/MCTargetDesc/M68kMemOperandPrinter.h [new file with mode: 0644]