1 //===-- BPFTargetInfo.cpp - BPF Target Implementation ---------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "TargetInfo/BPFTargetInfo.h"
10 #include "llvm/Support/TargetRegistry.h"
14 Target
&llvm::getTheBPFleTarget() {
15 static Target TheBPFleTarget
;
16 return TheBPFleTarget
;
18 Target
&llvm::getTheBPFbeTarget() {
19 static Target TheBPFbeTarget
;
20 return TheBPFbeTarget
;
22 Target
&llvm::getTheBPFTarget() {
23 static Target TheBPFTarget
;
27 extern "C" void LLVMInitializeBPFTargetInfo() {
28 TargetRegistry::RegisterTarget(getTheBPFTarget(), "bpf", "BPF (host endian)",
29 "BPF", [](Triple::ArchType
) { return false; },
31 RegisterTarget
<Triple::bpfel
, /*HasJIT=*/true> X(
32 getTheBPFleTarget(), "bpfel", "BPF (little endian)", "BPF");
33 RegisterTarget
<Triple::bpfeb
, /*HasJIT=*/true> Y(getTheBPFbeTarget(), "bpfeb",
34 "BPF (big endian)", "BPF");