LLVM  14.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"
19 
21 #include "llvm/MC/MCStreamer.h"
22 #include "llvm/Support/Compiler.h"
24 #include <memory>
25 #include <utility>
26 
27 namespace llvm {
28 class MCStreamer;
29 class MachineInstr;
30 class MachineBasicBlock;
31 class Module;
32 class raw_ostream;
33 
34 class M68kSubtarget;
35 class M68kMachineFunctionInfo;
36 
38 
39  void EmitInstrWithMacroNoAT(const MachineInstr *MI);
40 
41  void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &OS);
42 
43 public:
46  std::unique_ptr<M68kMCInstLower> MCInstLowering;
47 
49  std::unique_ptr<MCStreamer> Streamer)
50  : AsmPrinter(TM, std::move(Streamer)) {
51  Subtarget = static_cast<M68kTargetMachine &>(TM).getSubtargetImpl();
52  }
53 
54  StringRef getPassName() const override { return "M68k Assembly Printer"; }
55 
56  virtual bool runOnMachineFunction(MachineFunction &MF) override;
57 
58  bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
59  const char *ExtraCode, raw_ostream &OS) override;
60 
61  void emitInstruction(const MachineInstr *MI) override;
62  void emitFunctionBodyStart() override;
63  void emitFunctionBodyEnd() override;
64  void emitStartOfAsmFile(Module &M) override;
65  void emitEndOfAsmFile(Module &M) override;
66 };
67 } // namespace llvm
68 
69 #endif
AsmPrinter.h
M68kMCInstLower.h
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::M68kTargetMachine
Definition: M68kTargetMachine.h:29
llvm::M68kAsmPrinter::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: M68kAsmPrinter.h:54
M68kTargetMachine.h
llvm::M68kAsmPrinter::MCInstLowering
std::unique_ptr< M68kMCInstLower > MCInstLowering
Definition: M68kAsmPrinter.h:46
printOperand
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
Definition: SelectionDAGDumper.cpp:946
llvm::M68kAsmPrinter::MMFI
const M68kMachineFunctionInfo * MMFI
Definition: M68kAsmPrinter.h:45
llvm::M68kAsmPrinter::M68kAsmPrinter
M68kAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
Definition: M68kAsmPrinter.h:48
TargetMachine.h
llvm::M68kAsmPrinter
Definition: M68kAsmPrinter.h:37
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::M68kSubtarget
Definition: M68kSubtarget.h:45
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::move
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:1609
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MachineFunction
Definition: MachineFunction.h:234
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::M68kMachineFunctionInfo
Definition: M68kMachineFunction.h:23
Compiler.h
LLVM_LIBRARY_VISIBILITY
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library,...
Definition: Compiler.h:131
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::M68kAsmPrinter::Subtarget
const M68kSubtarget * Subtarget
Definition: M68kAsmPrinter.h:44
std
Definition: BitVector.h:838
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:81
MCStreamer.h
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47