BPFInstPrinter.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===-- BPFInstPrinter.h - Convert BPF MCInst to asm syntax -------*- 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 BPF MCInst to a .s file.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFINSTPRINTER_H
  13. #define LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFINSTPRINTER_H
  14. #include "llvm/MC/MCInstPrinter.h"
  15. namespace llvm {
  16. class BPFInstPrinter : public MCInstPrinter {
  17. public:
  18. BPFInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
  19. const MCRegisterInfo &MRI)
  20. : MCInstPrinter(MAI, MII, MRI) {}
  21. void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,
  22. const MCSubtargetInfo &STI, raw_ostream &O) override;
  23. void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,
  24. const char *Modifier = nullptr);
  25. void printMemOperand(const MCInst *MI, int OpNo, raw_ostream &O,
  26. const char *Modifier = nullptr);
  27. void printImm64Operand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
  28. void printBrTargetOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
  29. // Autogenerated by tblgen.
  30. std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override;
  31. void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O);
  32. static const char *getRegisterName(unsigned RegNo);
  33. };
  34. }
  35. #endif