LLVM  4.0.0
BPFTargetInfo.cpp
Go to the documentation of this file.
1 //===-- BPFTargetInfo.cpp - BPF Target Implementation ---------------------===//
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 #include "BPF.h"
12 using namespace llvm;
13 
14 namespace llvm {
16  static Target TheBPFleTarget;
17  return TheBPFleTarget;
18 }
20  static Target TheBPFbeTarget;
21  return TheBPFbeTarget;
22 }
24  static Target TheBPFTarget;
25  return TheBPFTarget;
26 }
27 } // namespace llvm
28 
29 extern "C" void LLVMInitializeBPFTargetInfo() {
30  TargetRegistry::RegisterTarget(getTheBPFTarget(), "bpf", "BPF (host endian)",
31  [](Triple::ArchType) { return false; }, true);
32  RegisterTarget<Triple::bpfel, /*HasJIT=*/true> X(getTheBPFleTarget(), "bpfel",
33  "BPF (little endian)");
34  RegisterTarget<Triple::bpfeb, /*HasJIT=*/true> Y(getTheBPFbeTarget(), "bpfeb",
35  "BPF (big endian)");
36 }
RegisterTarget - Helper template for registering a target, for use in the target's initialization fun...
void LLVMInitializeBPFTargetInfo()
static void RegisterTarget(Target &T, const char *Name, const char *ShortDesc, Target::ArchMatchFnTy ArchMatchFn, bool HasJIT=false)
RegisterTarget - Register the given target.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
Target - Wrapper for Target specific information.
Target & getTheBPFleTarget()
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
Target & getTheBPFbeTarget()
Target & getTheBPFTarget()