Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/BPF/BPFTargetMachine.h
Line
Count
Source
1
//===-- BPFTargetMachine.h - Define TargetMachine for BPF --- C++ ---===//
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
// This file declares the BPF specific subclass of TargetMachine.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_LIB_TARGET_BPF_BPFTARGETMACHINE_H
14
#define LLVM_LIB_TARGET_BPF_BPFTARGETMACHINE_H
15
16
#include "BPFSubtarget.h"
17
#include "llvm/Target/TargetMachine.h"
18
19
namespace llvm {
20
class BPFTargetMachine : public LLVMTargetMachine {
21
  std::unique_ptr<TargetLoweringObjectFile> TLOF;
22
  BPFSubtarget Subtarget;
23
24
public:
25
  BPFTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
26
                   StringRef FS, const TargetOptions &Options,
27
                   Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
28
                   CodeGenOpt::Level OL, bool JIT);
29
30
412
  const BPFSubtarget *getSubtargetImpl() const { return &Subtarget; }
31
3.52k
  const BPFSubtarget *getSubtargetImpl(const Function &) const override {
32
3.52k
    return &Subtarget;
33
3.52k
  }
34
35
  TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
36
37
4.49k
  TargetLoweringObjectFile *getObjFileLowering() const override {
38
4.49k
    return TLOF.get();
39
4.49k
  }
40
};
41
}
42
43
#endif