Path: blob/main/contrib/llvm-project/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.h
35294 views
//===-- SPIRVInstPrinter.h - Output SPIR-V MCInsts as ASM -------*- 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// This class prints a SPIR-V MCInst to a .s file.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_SPIRV_INSTPRINTER_SPIRVINSTPRINTER_H13#define LLVM_LIB_TARGET_SPIRV_INSTPRINTER_SPIRVINSTPRINTER_H1415#include "MCTargetDesc/SPIRVBaseInfo.h"16#include "llvm/ADT/DenseSet.h"17#include "llvm/MC/MCInstPrinter.h"1819namespace llvm {20class SPIRVInstPrinter : public MCInstPrinter {21private:22SmallDenseMap<unsigned, SPIRV::InstructionSet::InstructionSet> ExtInstSetIDs;23void recordOpExtInstImport(const MCInst *MI);2425public:26using MCInstPrinter::MCInstPrinter;2728void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,29const MCSubtargetInfo &STI, raw_ostream &OS) override;30void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,31const char *Modifier = nullptr);3233void printStringImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);3435void printOpDecorate(const MCInst *MI, raw_ostream &O);36void printOpExtInst(const MCInst *MI, raw_ostream &O);37void printRemainingVariableOps(const MCInst *MI, unsigned StartIndex,38raw_ostream &O, bool SkipFirstSpace = false,39bool SkipImmediates = false);40void printOpConstantVarOps(const MCInst *MI, unsigned StartIndex,41raw_ostream &O);4243void printExtension(const MCInst *MI, unsigned OpNo, raw_ostream &O);44template <SPIRV::OperandCategory::OperandCategory category>45void printSymbolicOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);4647// Autogenerated by tblgen.48std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override;49void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O);50static const char *getRegisterName(MCRegister Reg);51};52} // namespace llvm5354#endif // LLVM_LIB_TARGET_SPIRV_INSTPRINTER_SPIRVINSTPRINTER_H555657