Coverage Report

Created: 2020-09-22 08:39

/Users/buildslave/jenkins/workspace/coverage/llvm-project/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 Tool {
21
public:
22
38
  Linker(const ToolChain &TC) : Tool("fuchsia::Linker", "ld.lld", TC) {}
23
24
38
  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
39
  bool HasNativeLLVMSupport() const override { return true; }
43
283
  bool IsIntegratedAssemblerDefault() const override { return true; }
44
41
  bool IsMathErrnoDefault() const override { return false; }
45
39
  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
41
  bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override {
53
41
    return true;
54
41
  }
55
0
  bool isPICDefault() const override { return false; }
56
41
  bool isPIEDefault() const override { return true; }
57
41
  bool isPICDefaultForced() const override { return false; }
58
41
  llvm::DebuggerKind getDefaultDebuggerTuning() const override {
59
41
    return llvm::DebuggerKind::GDB;
60
41
  }
61
62
41
  unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
63
41
    return 2; // SSPStrong
64
41
  }
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
  void addProfileRTLibs(const llvm::opt::ArgList &Args,
73
                        llvm::opt::ArgStringList &CmdArgs) const override;
74
75
  RuntimeLibType
76
  GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
77
  CXXStdlibType
78
  GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
79
80
  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
81
                             llvm::opt::ArgStringList &CC1Args,
82
                             Action::OffloadKind DeviceOffloadKind) const override;
83
  void
84
  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
85
                            llvm::opt::ArgStringList &CC1Args) const override;
86
  void
87
  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
88
                               llvm::opt::ArgStringList &CC1Args) const override;
89
  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
90
                           llvm::opt::ArgStringList &CmdArgs) const override;
91
92
40
  const char *getDefaultLinker() const override {
93
40
    return "ld.lld";
94
40
  }
95
96
protected:
97
  Tool *buildLinker() const override;
98
};
99
100
} // end namespace toolchains
101
} // end namespace driver
102
} // end namespace clang
103
104
#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H