LLVM 22.0.0git
M68kAsmPrinter.h
Go to the documentation of this file.
1//===-- M68kAsmPrinter.h - M68k LLVM Assembly Printer -----------*- 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 M68k assembler printer declarations.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_M68K_M68KASMPRINTER_H
15#define LLVM_LIB_TARGET_M68K_M68KASMPRINTER_H
16
17#include "M68kMCInstLower.h"
18#include "M68kTargetMachine.h"
20
22#include "llvm/MC/MCStreamer.h"
25#include <memory>
26#include <utility>
27
28namespace llvm {
29class MCStreamer;
30class MachineInstr;
32class Module;
33class raw_ostream;
34
35class M68kSubtarget;
37
39 : public AsmPrinter,
40 public M68kMemOperandPrinter<M68kAsmPrinter, MachineInstr> {
41
43
44 void EmitInstrWithMacroNoAT(const MachineInstr *MI);
45
46 void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &OS);
47
48 void printDisp(const MachineInstr *MI, unsigned OpNum, raw_ostream &OS);
49 void printAbsMem(const MachineInstr *MI, unsigned OpNum, raw_ostream &OS);
50
51public:
52 static char ID;
53
56 std::unique_ptr<M68kMCInstLower> MCInstLowering;
57
59 std::unique_ptr<MCStreamer> Streamer)
60 : AsmPrinter(TM, std::move(Streamer), ID) {
62 }
63
64 StringRef getPassName() const override { return "M68k Assembly Printer"; }
65
66 virtual bool runOnMachineFunction(MachineFunction &MF) override;
67
68 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
69 const char *ExtraCode, raw_ostream &OS) override;
70 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
71 const char *ExtraCode, raw_ostream &OS) override;
72
73 void emitInstruction(const MachineInstr *MI) override;
74 void emitFunctionBodyStart() override;
75 void emitFunctionBodyEnd() override;
76 void emitStartOfAsmFile(Module &M) override;
77 void emitEndOfAsmFile(Module &M) override;
78};
79} // namespace llvm
80
81#endif // LLVM_LIB_TARGET_M68K_M68KASMPRINTER_H
#define LLVM_LIBRARY_VISIBILITY
Definition Compiler.h:137
IRTranslator LLVM IR MI
This file contains code to lower M68k MachineInstrs to their corresponding MCInst records.
This file contains memory operand printing logics shared between AsmPrinter.
This file declares the M68k specific subclass of TargetMachine.
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
TargetMachine & TM
Target machine description.
Definition AsmPrinter.h:93
AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer, char &ID=AsmPrinter::ID)
M68kAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
std::unique_ptr< M68kMCInstLower > MCInstLowering
const M68kSubtarget * Subtarget
const M68kMachineFunctionInfo * MMFI
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
friend class M68kMemOperandPrinter
const M68kSubtarget * getSubtargetImpl() const
Streaming machine code generation interface.
Definition MCStreamer.h:220
Representation of each machine instruction.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
Primary interface to the complete machine description for the target machine.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1849
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851