Path: blob/main/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchAsmPrinter.h
35269 views
//===- LoongArchAsmPrinter.h - LoongArch LLVM Assembly Printer -*- 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//===----------------------------------------------------------------------===//7//8// LoongArch Assembly printer class.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHASMPRINTER_H13#define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHASMPRINTER_H1415#include "LoongArchSubtarget.h"16#include "llvm/CodeGen/AsmPrinter.h"17#include "llvm/MC/MCStreamer.h"18#include "llvm/Support/Compiler.h"1920namespace llvm {2122class LLVM_LIBRARY_VISIBILITY LoongArchAsmPrinter : public AsmPrinter {23const MCSubtargetInfo *STI;2425public:26explicit LoongArchAsmPrinter(TargetMachine &TM,27std::unique_ptr<MCStreamer> Streamer)28: AsmPrinter(TM, std::move(Streamer)), STI(TM.getMCSubtargetInfo()) {}2930StringRef getPassName() const override {31return "LoongArch Assembly Printer";32}3334bool runOnMachineFunction(MachineFunction &MF) override;3536void emitInstruction(const MachineInstr *MI) override;3738bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,39const char *ExtraCode, raw_ostream &OS) override;40bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,41const char *ExtraCode, raw_ostream &OS) override;4243void LowerPATCHABLE_FUNCTION_ENTER(const MachineInstr &MI);44void LowerPATCHABLE_FUNCTION_EXIT(const MachineInstr &MI);45void LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI);46void emitSled(const MachineInstr &MI, SledKind Kind);4748// tblgen'erated function.49bool emitPseudoExpansionLowering(MCStreamer &OutStreamer,50const MachineInstr *MI);51// Wrapper needed for tblgenned pseudo lowering.52bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const {53return lowerLoongArchMachineOperandToMCOperand(MO, MCOp, *this);54}55};5657} // end namespace llvm5859#endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHASMPRINTER_H606162