[bpf] add big- and host- endian support
[oota-llvm.git] / lib / Target / BPF / MCTargetDesc / BPFMCTargetDesc.h
1 //===-- BPFMCTargetDesc.h - BPF Target Descriptions -------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file provides BPF specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCTARGETDESC_H
15 #define LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCTARGETDESC_H
16
17 #include "llvm/Support/DataTypes.h"
18 #include "llvm/Config/config.h"
19
20 namespace llvm {
21 class MCAsmBackend;
22 class MCCodeEmitter;
23 class MCContext;
24 class MCInstrInfo;
25 class MCObjectWriter;
26 class MCRegisterInfo;
27 class MCSubtargetInfo;
28 class Target;
29 class StringRef;
30 class raw_ostream;
31 class raw_pwrite_stream;
32
33 extern Target TheBPFleTarget;
34 extern Target TheBPFbeTarget;
35 extern Target TheBPFTarget;
36
37 MCCodeEmitter *createBPFMCCodeEmitter(const MCInstrInfo &MCII,
38                                       const MCRegisterInfo &MRI,
39                                       MCContext &Ctx);
40 MCCodeEmitter *createBPFbeMCCodeEmitter(const MCInstrInfo &MCII,
41                                         const MCRegisterInfo &MRI,
42                                         MCContext &Ctx);
43
44 MCAsmBackend *createBPFAsmBackend(const Target &T, const MCRegisterInfo &MRI,
45                                   StringRef TT, StringRef CPU);
46 MCAsmBackend *createBPFbeAsmBackend(const Target &T, const MCRegisterInfo &MRI,
47                                     StringRef TT, StringRef CPU);
48
49 MCObjectWriter *createBPFELFObjectWriter(raw_pwrite_stream &OS,
50                                          uint8_t OSABI, bool IsLittleEndian);
51 }
52
53 // Defines symbolic names for BPF registers.  This defines a mapping from
54 // register name to register number.
55 //
56 #define GET_REGINFO_ENUM
57 #include "BPFGenRegisterInfo.inc"
58
59 // Defines symbolic names for the BPF instructions.
60 //
61 #define GET_INSTRINFO_ENUM
62 #include "BPFGenInstrInfo.inc"
63
64 #define GET_SUBTARGETINFO_ENUM
65 #include "BPFGenSubtargetInfo.inc"
66
67 #endif