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