Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Driver/ToolChains/Fuchsia.h
Line
Count
Source (jump to first uncovered line)
1
//===--- Fuchsia.h - Fuchsia 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_FUCHSIA_H
10
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H
11
12
#include "Gnu.h"
13
#include "clang/Driver/Tool.h"
14
#include "clang/Driver/ToolChain.h"
15
16
namespace clang {
17
namespace driver {
18
namespace tools {
19
namespace fuchsia {
20
class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
21
public:
22
30
  Linker(const ToolChain &TC) : GnuTool("fuchsia::Linker", "ld.lld", TC) {}
23
24
30
  bool hasIntegratedCPP() const override { return false; }
25
0
  bool isLinkJob() const override { return true; }
26
27
  void ConstructJob(Compilation &C, const JobAction &JA,
28
                    const InputInfo &Output, const InputInfoList &Inputs,
29
                    const llvm::opt::ArgList &TCArgs,
30
                    const char *LinkingOutput) const override;
31
};
32
} // end namespace fuchsia
33
} // end namespace tools
34
35
namespace toolchains {
36
37
class LLVM_LIBRARY_VISIBILITY Fuchsia : public ToolChain {
38
public:
39
  Fuchsia(const Driver &D, const llvm::Triple &Triple,
40
          const llvm::opt::ArgList &Args);
41
42
31
  bool HasNativeLLVMSupport() const override { return true; }
43
225
  bool IsIntegratedAssemblerDefault() const override { return true; }
44
33
  bool IsMathErrnoDefault() const override { return false; }
45
31
  bool useRelaxRelocations() const override { return true; };
46
0
  RuntimeLibType GetDefaultRuntimeLibType() const override {
47
0
    return ToolChain::RLT_CompilerRT;
48
0
  }
49
0
  CXXStdlibType GetDefaultCXXStdlibType() const override {
50
0
    return ToolChain::CST_Libcxx;
51
0
  }
52
33
  bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override {
53
33
    return true;
54
33
  }
55
0
  bool isPICDefault() const override { return false; }
56
33
  bool isPIEDefault() const override { return true; }
57
33
  bool isPICDefaultForced() const override { return false; }
58
33
  llvm::DebuggerKind getDefaultDebuggerTuning() const override {
59
33
    return llvm::DebuggerKind::GDB;
60
33
  }
61
62
33
  unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
63
33
    return 2; // SSPStrong
64
33
  }
65
66
  std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
67
                                          types::ID InputType) const override;
68
69
  SanitizerMask getSupportedSanitizers() const override;
70
  SanitizerMask getDefaultSanitizers() const override;
71
72
  RuntimeLibType
73
  GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
74
  CXXStdlibType
75
  GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
76
77
  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
78
                             llvm::opt::ArgStringList &CC1Args,
79
                             Action::OffloadKind DeviceOffloadKind) const override;
80
  void
81
  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
82
                            llvm::opt::ArgStringList &CC1Args) const override;
83
  void
84
  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
85
                               llvm::opt::ArgStringList &CC1Args) const override;
86
  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
87
                           llvm::opt::ArgStringList &CmdArgs) const override;
88
89
0
  const char *getDefaultLinker() const override {
90
0
    return "ld.lld";
91
0
  }
92
93
protected:
94
  Tool *buildLinker() const override;
95
};
96
97
} // end namespace toolchains
98
} // end namespace driver
99
} // end namespace clang
100
101
#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H