Alexei Starovoitov | e4c8c80 | 2015-01-24 17:51:26 +0000 | [diff] [blame] | 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" |
| 11 | #include "llvm/Support/TargetRegistry.h" |
| 12 | using namespace llvm; |
| 13 | |
Alexei Starovoitov | 310dead | 2015-06-04 19:15:05 +0000 | [diff] [blame] | 14 | namespace llvm { |
| 15 | Target TheBPFleTarget; |
| 16 | Target TheBPFbeTarget; |
| 17 | Target TheBPFTarget; |
| 18 | } |
Alexei Starovoitov | e4c8c80 | 2015-01-24 17:51:26 +0000 | [diff] [blame] | 19 | |
| 20 | extern "C" void LLVMInitializeBPFTargetInfo() { |
Alexei Starovoitov | 310dead | 2015-06-04 19:15:05 +0000 | [diff] [blame] | 21 | TargetRegistry::RegisterTarget(TheBPFTarget, "bpf", |
| 22 | "BPF (host endian)", |
| 23 | [](Triple::ArchType) { return false; }, true); |
Alexei Starovoitov | 8cf9a4c | 2015-06-05 16:11:14 +0000 | [diff] [blame] | 24 | RegisterTarget<Triple::bpfel, /*HasJIT=*/true> X( |
| 25 | TheBPFleTarget, "bpfel", "BPF (little endian)"); |
| 26 | RegisterTarget<Triple::bpfeb, /*HasJIT=*/true> Y( |
| 27 | TheBPFbeTarget, "bpfeb", "BPF (big endian)"); |
Alexei Starovoitov | e4c8c80 | 2015-01-24 17:51:26 +0000 | [diff] [blame] | 28 | } |