Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Driver/ToolChains/AMDGPU.h
Line
Count
Source (jump to first uncovered line)
1
//===--- AMDGPU.h - AMDGPU ToolChain Implementations ----------*- 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
#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AMDGPU_H
10
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AMDGPU_H
11
12
#include "Gnu.h"
13
#include "clang/Driver/Options.h"
14
#include "clang/Driver/Tool.h"
15
#include "clang/Driver/ToolChain.h"
16
#include <map>
17
18
namespace clang {
19
namespace driver {
20
namespace tools {
21
namespace amdgpu {
22
23
class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
24
public:
25
9
  Linker(const ToolChain &TC) : GnuTool("amdgpu::Linker", "ld.lld", TC) {}
26
0
  bool isLinkJob() const override { return true; }
27
9
  bool hasIntegratedCPP() const override { return false; }
28
  void ConstructJob(Compilation &C, const JobAction &JA,
29
                    const InputInfo &Output, const InputInfoList &Inputs,
30
                    const llvm::opt::ArgList &TCArgs,
31
                    const char *LinkingOutput) const override;
32
};
33
34
void getAMDGPUTargetFeatures(const Driver &D, const llvm::opt::ArgList &Args,
35
                             std::vector<StringRef> &Features);
36
37
} // end namespace amdgpu
38
} // end namespace tools
39
40
namespace toolchains {
41
42
class LLVM_LIBRARY_VISIBILITY AMDGPUToolChain : public Generic_ELF {
43
44
private:
45
  const std::map<options::ID, const StringRef> OptionsDefault;
46
47
protected:
48
  Tool *buildLinker() const override;
49
4
  const StringRef getOptionDefault(options::ID OptID) const {
50
4
    auto opt = OptionsDefault.find(OptID);
51
4
    assert(opt != OptionsDefault.end() && "No Default for Option");
52
4
    return opt->second;
53
4
  }
54
55
public:
56
  AMDGPUToolChain(const Driver &D, const llvm::Triple &Triple,
57
                  const llvm::opt::ArgList &Args);
58
11
  unsigned GetDefaultDwarfVersion() const override { return 5; }
59
164
  bool IsIntegratedAssemblerDefault() const override { return true; }
60
26
  bool IsMathErrnoDefault() const override { return false; }
61
62
  llvm::opt::DerivedArgList *
63
  TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
64
                Action::OffloadKind DeviceOffloadKind) const override;
65
66
  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
67
                             llvm::opt::ArgStringList &CC1Args,
68
                             Action::OffloadKind DeviceOffloadKind) const override;
69
};
70
71
} // end namespace toolchains
72
} // end namespace driver
73
} // end namespace clang
74
75
#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AMDGPU_H