[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / llvm / lib / Target / SPIRV / MCTargetDesc / SPIRVInstPrinter.h
blob424249a09e56a5d90df93d75b191081c04aac342
1 //===-- SPIRVInstPrinter.h - Output SPIR-V MCInsts as ASM -------*- 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 // This class prints a SPIR-V MCInst to a .s file.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_SPIRV_INSTPRINTER_SPIRVINSTPRINTER_H
14 #define LLVM_LIB_TARGET_SPIRV_INSTPRINTER_SPIRVINSTPRINTER_H
16 #include "MCTargetDesc/SPIRVBaseInfo.h"
17 #include "llvm/ADT/DenseSet.h"
18 #include "llvm/MC/MCInstPrinter.h"
20 namespace llvm {
21 class SPIRVInstPrinter : public MCInstPrinter {
22 private:
23 SmallDenseMap<unsigned, SPIRV::InstructionSet::InstructionSet> ExtInstSetIDs;
24 void recordOpExtInstImport(const MCInst *MI);
26 public:
27 using MCInstPrinter::MCInstPrinter;
29 void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,
30 const MCSubtargetInfo &STI, raw_ostream &OS) override;
31 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,
32 const char *Modifier = nullptr);
34 void printStringImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
36 void printOpDecorate(const MCInst *MI, raw_ostream &O);
37 void printOpExtInst(const MCInst *MI, raw_ostream &O);
38 void printRemainingVariableOps(const MCInst *MI, unsigned StartIndex,
39 raw_ostream &O, bool SkipFirstSpace = false,
40 bool SkipImmediates = false);
41 void printOpConstantVarOps(const MCInst *MI, unsigned StartIndex,
42 raw_ostream &O);
44 void printExtension(const MCInst *MI, unsigned OpNo, raw_ostream &O);
45 template <SPIRV::OperandCategory::OperandCategory category>
46 void printSymbolicOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
48 // Autogenerated by tblgen.
49 std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override;
50 void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O);
51 static const char *getRegisterName(MCRegister Reg);
53 } // namespace llvm
55 #endif // LLVM_LIB_TARGET_SPIRV_INSTPRINTER_SPIRVINSTPRINTER_H