BPFMCTargetDesc.h 2.1 KB

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