[RISCV] Add support for Smepmp 1.0 (#78489)
[llvm-project.git] / llvm / lib / Target / M68k / M68kMCInstLower.h
blob2d19a8d6732d5b49cf91fc28cbd28f1de4c85845
1 //===-- M68kMCInstLower.h - Lower MachineInstr to MCInst --------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file contains code to lower M68k MachineInstrs to their
11 /// corresponding MCInst records.
12 ///
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"
22 namespace llvm {
23 class MCContext;
24 class MCInst;
25 class MCOperand;
26 class MachineInstr;
27 class MachineFunction;
28 class M68kAsmPrinter;
30 /// This class is used to lower an MachineInstr into an MCInst.
31 class M68kMCInstLower {
32 typedef MachineOperand::MachineOperandType MachineOperandType;
33 MCContext &Ctx;
34 MachineFunction &MF;
35 const TargetMachine &TM;
36 const MCAsmInfo &MAI;
37 M68kAsmPrinter &AsmPrinter;
39 public:
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;
52 } // namespace llvm
54 #endif // LLVM_LIB_TARGET_M68K_M68KMCINSTLOWER_H