1 //===-- CSKYAsmPrinter.h - CSKY implementation of AsmPrinter ----*- 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 #ifndef LLVM_LIB_TARGET_CSKY_CSKYASMPRINTER_H 10 #define LLVM_LIB_TARGET_CSKY_CSKYASMPRINTER_H 11 12 #include "CSKYMCInstLower.h" 13 #include "CSKYSubtarget.h" 14 #include "llvm/CodeGen/AsmPrinter.h" 15 #include "llvm/MC/MCDirectives.h" 16 17 namespace llvm { 18 class LLVM_LIBRARY_VISIBILITY CSKYAsmPrinter : public AsmPrinter { 19 CSKYMCInstLower MCInstLowering; 20 21 const CSKYSubtarget *Subtarget; 22 23 public: 24 explicit CSKYAsmPrinter(TargetMachine &TM, 25 std::unique_ptr<MCStreamer> Streamer); 26 27 StringRef getPassName() const override { return "CSKY Assembly Printer"; } 28 29 /// tblgen'erated driver function for lowering simple MI->MC 30 /// pseudo instructions. 31 bool emitPseudoExpansionLowering(MCStreamer &OutStreamer, 32 const MachineInstr *MI); 33 34 void emitInstruction(const MachineInstr *MI) override; 35 36 bool runOnMachineFunction(MachineFunction &MF) override; 37 }; 38 } // end namespace llvm 39 40 #endif // LLVM_LIB_TARGET_CSKY_CSKYASMPRINTER_H 41