brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 6ea6cd5 Raw
38 lines · cpp
1//===-- BPFTargetInfo.cpp - BPF Target Implementation ---------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "TargetInfo/BPFTargetInfo.h"10#include "llvm/MC/TargetRegistry.h"11#include "llvm/Support/Compiler.h"12 13using namespace llvm;14 15Target &llvm::getTheBPFleTarget() {16  static Target TheBPFleTarget;17  return TheBPFleTarget;18}19Target &llvm::getTheBPFbeTarget() {20  static Target TheBPFbeTarget;21  return TheBPFbeTarget;22}23Target &llvm::getTheBPFTarget() {24  static Target TheBPFTarget;25  return TheBPFTarget;26}27 28extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void29LLVMInitializeBPFTargetInfo() {30  TargetRegistry::RegisterTarget(getTheBPFTarget(), "bpf", "BPF (host endian)",31                                 "BPF", [](Triple::ArchType) { return false; },32                                 true);33  RegisterTarget<Triple::bpfel, /*HasJIT=*/true> X(34      getTheBPFleTarget(), "bpfel", "BPF (little endian)", "BPF");35  RegisterTarget<Triple::bpfeb, /*HasJIT=*/true> Y(getTheBPFbeTarget(), "bpfeb",36                                                   "BPF (big endian)", "BPF");37}38