Coverage Report

Created: 2021-01-19 06:58

/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/Basic/LangOptions.h"
14
#include "clang/Driver/Tool.h"
15
#include "clang/Driver/ToolChain.h"
16
17
namespace clang {
18
namespace driver {
19
namespace tools {
20
namespace fuchsia {
21
class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
22
public:
23
40
  Linker(const ToolChain &TC) : Tool("fuchsia::Linker", "ld.lld", TC) {}
24
25
40
  bool hasIntegratedCPP() const override { return false; }
26
0
  bool isLinkJob() const override { return true; }
27
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
} // end namespace fuchsia
34
} // end namespace tools
35
36
namespace toolchains {
37
38
class LLVM_LIBRARY_VISIBILITY Fuchsia : public ToolChain {
39
public:
40
  Fuchsia(const Driver &D, const llvm::Triple &Triple,
41
          const llvm::opt::ArgList &Args);
42
43
41
  bool HasNativeLLVMSupport() const override { return true; }
44
297
  bool IsIntegratedAssemblerDefault() const override { return true; }
45
43
  bool IsMathErrnoDefault() const override { return false; }
46
41
  bool useRelaxRelocations() const override { return true; };
47
0
  RuntimeLibType GetDefaultRuntimeLibType() const override {
48
0
    return ToolChain::RLT_CompilerRT;
49
0
  }
50
0
  CXXStdlibType GetDefaultCXXStdlibType() const override {
51
0
    return ToolChain::CST_Libcxx;
52
0
  }
53
43
  bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override {
54
43
    return true;
55
43
  }
56
0
  bool isPICDefault() const override { return false; }
57
43
  bool isPIEDefault() const override { return true; }
58
43
  bool isPICDefaultForced() const override { return false; }
59
43
  llvm::DebuggerKind getDefaultDebuggerTuning() const override {
60
43
    return llvm::DebuggerKind::GDB;
61
43
  }
62
63
  LangOptions::StackProtectorMode
64
43
  GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
65
43
    return LangOptions::SSPStrong;
66
43
  }
67
68
  std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
69
                                          types::ID InputType) const override;
70
71
  SanitizerMask getSupportedSanitizers() const override;
72
  SanitizerMask getDefaultSanitizers() const override;
73
74
  void addProfileRTLibs(const llvm::opt::ArgList &Args,
75
                        llvm::opt::ArgStringList &CmdArgs) const override;
76
77
  RuntimeLibType
78
  GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
79
  CXXStdlibType
80
  GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
81
82
  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
83
                             llvm::opt::ArgStringList &CC1Args,
84
                             Action::OffloadKind DeviceOffloadKind) const override;
85
  void
86
  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
87
                            llvm::opt::ArgStringList &CC1Args) const override;
88
  void
89
  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
90
                               llvm::opt::ArgStringList &CC1Args) const override;
91
  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
92
                           llvm::opt::ArgStringList &CmdArgs) const override;
93
94
42
  const char *getDefaultLinker() const override {
95
42
    return "ld.lld";
96
42
  }
97
98
protected:
99
  Tool *buildLinker() const override;
100
};
101
102
} // end namespace toolchains
103
} // end namespace driver
104
} // end namespace clang
105
106
#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H