Path: blob/main/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYAsmPrinter.h
35266 views
//===-- CSKYAsmPrinter.h - CSKY implementation of AsmPrinter ----*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIB_TARGET_CSKY_CSKYASMPRINTER_H9#define LLVM_LIB_TARGET_CSKY_CSKYASMPRINTER_H1011#include "CSKYMCInstLower.h"12#include "CSKYSubtarget.h"13#include "llvm/CodeGen/AsmPrinter.h"14#include "llvm/MC/MCDirectives.h"1516namespace llvm {17class LLVM_LIBRARY_VISIBILITY CSKYAsmPrinter : public AsmPrinter {18CSKYMCInstLower MCInstLowering;1920const MCSubtargetInfo *Subtarget;21const TargetInstrInfo *TII;2223bool InConstantPool = false;2425/// Keep a pointer to constantpool entries of the current26/// MachineFunction.27MachineConstantPool *MCP;2829void expandTLSLA(const MachineInstr *MI);30void emitCustomConstantPool(const MachineInstr *MI);31void emitAttributes();3233public:34explicit CSKYAsmPrinter(TargetMachine &TM,35std::unique_ptr<MCStreamer> Streamer);3637StringRef getPassName() const override { return "CSKY Assembly Printer"; }3839void EmitToStreamer(MCStreamer &S, const MCInst &Inst);4041/// tblgen'erated driver function for lowering simple MI->MC42/// pseudo instructions.43bool emitPseudoExpansionLowering(MCStreamer &OutStreamer,44const MachineInstr *MI);4546void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;4748void emitFunctionBodyEnd() override;4950void emitStartOfAsmFile(Module &M) override;5152void emitEndOfAsmFile(Module &M) override;5354void emitInstruction(const MachineInstr *MI) override;5556bool runOnMachineFunction(MachineFunction &MF) override;5758// we emit constant pools customly!59void emitConstantPool() override {}6061bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,62const char *ExtraCode, raw_ostream &OS) override;6364bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,65const char *ExtraCode, raw_ostream &OS) override;66};67} // end namespace llvm6869#endif // LLVM_LIB_TARGET_CSKY_CSKYASMPRINTER_H707172