1 //===-- M68kMCInstLower.h - Lower MachineInstr to MCInst --------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// This file contains code to lower M68k MachineInstrs to their
11 /// corresponding MCInst records.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_M68K_M68KMCINSTLOWER_H
16 #define LLVM_LIB_TARGET_M68K_M68KMCINSTLOWER_H
18 #include "llvm/CodeGen/MachineOperand.h"
19 #include "llvm/MC/MCAsmInfo.h"
20 #include "llvm/Target/TargetMachine.h"
27 class MachineFunction
;
30 /// This class is used to lower an MachineInstr into an MCInst.
31 class M68kMCInstLower
{
32 typedef MachineOperand::MachineOperandType MachineOperandType
;
35 const TargetMachine
&TM
;
37 M68kAsmPrinter
&AsmPrinter
;
40 M68kMCInstLower(MachineFunction
&MF
, M68kAsmPrinter
&AP
);
42 /// Lower an MO_GlobalAddress or MO_ExternalSymbol operand to an MCSymbol.
43 MCSymbol
*GetSymbolFromOperand(const MachineOperand
&MO
) const;
45 MCOperand
LowerSymbolOperand(const MachineOperand
&MO
, MCSymbol
*Sym
) const;
47 std::optional
<MCOperand
> LowerOperand(const MachineInstr
*MI
,
48 const MachineOperand
&MO
) const;
50 void Lower(const MachineInstr
*MI
, MCInst
&OutMI
) const;
54 #endif // LLVM_LIB_TARGET_M68K_M68KMCINSTLOWER_H