LLVM  14.0.0git
BPFTargetInfo.cpp
Go to the documentation of this file.
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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
11 
12 using namespace llvm;
13 
15  static Target TheBPFleTarget;
16  return TheBPFleTarget;
17 }
19  static Target TheBPFbeTarget;
20  return TheBPFbeTarget;
21 }
23  static Target TheBPFTarget;
24  return TheBPFTarget;
25 }
26 
28  TargetRegistry::RegisterTarget(getTheBPFTarget(), "bpf", "BPF (host endian)",
29  "BPF", [](Triple::ArchType) { return false; },
30  true);
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");
35 }
llvm::getTheBPFleTarget
Target & getTheBPFleTarget()
Definition: BPFTargetInfo.cpp:14
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::Triple::bpfeb
@ bpfeb
Definition: Triple.h:58
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
BPFTargetInfo.h
llvm::Triple::ArchType
ArchType
Definition: Triple.h:47
Y
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:132
llvm::TargetRegistry::RegisterTarget
static void RegisterTarget(Target &T, const char *Name, const char *ShortDesc, const char *BackendName, Target::ArchMatchFnTy ArchMatchFn, bool HasJIT=false)
RegisterTarget - Register the given target.
Definition: TargetRegistry.cpp:88
llvm::getTheBPFbeTarget
Target & getTheBPFbeTarget()
Definition: BPFTargetInfo.cpp:18
llvm::Triple::bpfel
@ bpfel
Definition: Triple.h:57
llvm::RegisterTarget
RegisterTarget - Helper template for registering a target, for use in the target's initialization fun...
Definition: TargetRegistry.h:1057
llvm::getTheBPFTarget
Target & getTheBPFTarget()
Definition: BPFTargetInfo.cpp:22
LLVMInitializeBPFTargetInfo
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFTargetInfo()
Definition: BPFTargetInfo.cpp:27
TargetRegistry.h