xref: /aosp_15_r20/external/llvm/lib/Target/BPF/InstPrinter/BPFInstPrinter.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- BPFInstPrinter.h - Convert BPF MCInst to asm syntax -------*- C++ -*--//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This class prints a BPF MCInst to a .s file.
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker 
14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_BPF_INSTPRINTER_BPFINSTPRINTER_H
15*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_BPF_INSTPRINTER_BPFINSTPRINTER_H
16*9880d681SAndroid Build Coastguard Worker 
17*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCInstPrinter.h"
18*9880d681SAndroid Build Coastguard Worker 
19*9880d681SAndroid Build Coastguard Worker namespace llvm {
20*9880d681SAndroid Build Coastguard Worker class BPFInstPrinter : public MCInstPrinter {
21*9880d681SAndroid Build Coastguard Worker public:
BPFInstPrinter(const MCAsmInfo & MAI,const MCInstrInfo & MII,const MCRegisterInfo & MRI)22*9880d681SAndroid Build Coastguard Worker   BPFInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
23*9880d681SAndroid Build Coastguard Worker                  const MCRegisterInfo &MRI)
24*9880d681SAndroid Build Coastguard Worker       : MCInstPrinter(MAI, MII, MRI) {}
25*9880d681SAndroid Build Coastguard Worker 
26*9880d681SAndroid Build Coastguard Worker   void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
27*9880d681SAndroid Build Coastguard Worker                  const MCSubtargetInfo &STI) override;
28*9880d681SAndroid Build Coastguard Worker   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,
29*9880d681SAndroid Build Coastguard Worker                     const char *Modifier = nullptr);
30*9880d681SAndroid Build Coastguard Worker   void printMemOperand(const MCInst *MI, int OpNo, raw_ostream &O,
31*9880d681SAndroid Build Coastguard Worker                        const char *Modifier = nullptr);
32*9880d681SAndroid Build Coastguard Worker   void printImm64Operand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
33*9880d681SAndroid Build Coastguard Worker 
34*9880d681SAndroid Build Coastguard Worker   // Autogenerated by tblgen.
35*9880d681SAndroid Build Coastguard Worker   void printInstruction(const MCInst *MI, raw_ostream &O);
36*9880d681SAndroid Build Coastguard Worker   static const char *getRegisterName(unsigned RegNo);
37*9880d681SAndroid Build Coastguard Worker };
38*9880d681SAndroid Build Coastguard Worker }
39*9880d681SAndroid Build Coastguard Worker 
40*9880d681SAndroid Build Coastguard Worker #endif
41