1 //===-- BPFMCTargetDesc.h - BPF Target Descriptions -------------*- 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 file provides BPF specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCTARGETDESC_H
14 #define LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCTARGETDESC_H
15 
16 #include "llvm/Config/config.h"
17 #include "llvm/Support/DataTypes.h"
18 
19 #include <memory>
20 
21 namespace llvm {
22 class MCAsmBackend;
23 class MCCodeEmitter;
24 class MCContext;
25 class MCInstrInfo;
26 class MCObjectTargetWriter;
27 class MCRegisterInfo;
28 class MCSubtargetInfo;
29 class MCTargetOptions;
30 class Target;
31 
32 MCCodeEmitter *createBPFMCCodeEmitter(const MCInstrInfo &MCII,
33                                       const MCRegisterInfo &MRI,
34                                       MCContext &Ctx);
35 MCCodeEmitter *createBPFbeMCCodeEmitter(const MCInstrInfo &MCII,
36                                         const MCRegisterInfo &MRI,
37                                         MCContext &Ctx);
38 
39 MCAsmBackend *createBPFAsmBackend(const Target &T, const MCSubtargetInfo &STI,
40                                   const MCRegisterInfo &MRI,
41                                   const MCTargetOptions &Options);
42 MCAsmBackend *createBPFbeAsmBackend(const Target &T, const MCSubtargetInfo &STI,
43                                     const MCRegisterInfo &MRI,
44                                     const MCTargetOptions &Options);
45 
46 std::unique_ptr<MCObjectTargetWriter> createBPFELFObjectWriter(uint8_t OSABI);
47 }
48 
49 // Defines symbolic names for BPF registers.  This defines a mapping from
50 // register name to register number.
51 //
52 #define GET_REGINFO_ENUM
53 #include "BPFGenRegisterInfo.inc"
54 
55 // Defines symbolic names for the BPF instructions.
56 //
57 #define GET_INSTRINFO_ENUM
58 #include "BPFGenInstrInfo.inc"
59 
60 #define GET_SUBTARGETINFO_ENUM
61 #include "BPFGenSubtargetInfo.inc"
62 
63 #endif
64