Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/BPF/TargetInfo/BPFTargetInfo.cpp
Line
Count
Source
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
9
#include "TargetInfo/BPFTargetInfo.h"
10
#include "llvm/Support/TargetRegistry.h"
11
12
using namespace llvm;
13
14
770k
Target &llvm::getTheBPFleTarget() {
15
770k
  static Target TheBPFleTarget;
16
770k
  return TheBPFleTarget;
17
770k
}
18
770k
Target &llvm::getTheBPFbeTarget() {
19
770k
  static Target TheBPFbeTarget;
20
770k
  return TheBPFbeTarget;
21
770k
}
22
770k
Target &llvm::getTheBPFTarget() {
23
770k
  static Target TheBPFTarget;
24
770k
  return TheBPFTarget;
25
770k
}
26
27
157k
extern "C" void LLVMInitializeBPFTargetInfo() {
28
157k
  TargetRegistry::RegisterTarget(getTheBPFTarget(), "bpf", "BPF (host endian)",
29
157k
                                 "BPF", [](Triple::ArchType) 
{ return false; }61.3k
,
30
157k
                                 true);
31
157k
  RegisterTarget<Triple::bpfel, /*HasJIT=*/true> X(
32
157k
      getTheBPFleTarget(), "bpfel", "BPF (little endian)", "BPF");
33
157k
  RegisterTarget<Triple::bpfeb, /*HasJIT=*/true> Y(getTheBPFbeTarget(), "bpfeb",
34
157k
                                                   "BPF (big endian)", "BPF");
35
157k
}