[Transforms] Silence a warning in SROA.cpp (NFC)
[llvm-project.git] / clang / lib / Driver / ToolChains / Fuchsia.h
blob619968f5850240bb5f6388936109b69d4726a970
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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H
12 #include "Gnu.h"
13 #include "clang/Basic/LangOptions.h"
14 #include "clang/Driver/Tool.h"
15 #include "clang/Driver/ToolChain.h"
17 namespace clang {
18 namespace driver {
19 namespace tools {
20 namespace fuchsia {
21 class LLVM_LIBRARY_VISIBILITY StaticLibTool : public Tool {
22 public:
23 StaticLibTool(const ToolChain &TC)
24 : Tool("fuchsia::StaticLibTool", "llvm-ar", TC) {}
26 bool hasIntegratedCPP() const override { return false; }
27 bool isLinkJob() const override { return true; }
29 void ConstructJob(Compilation &C, const JobAction &JA,
30 const InputInfo &Output, const InputInfoList &Inputs,
31 const llvm::opt::ArgList &TCArgs,
32 const char *LinkingOutput) const override;
35 class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
36 public:
37 Linker(const ToolChain &TC) : Tool("fuchsia::Linker", "ld.lld", TC) {}
39 bool hasIntegratedCPP() const override { return false; }
40 bool isLinkJob() const override { return true; }
42 void ConstructJob(Compilation &C, const JobAction &JA,
43 const InputInfo &Output, const InputInfoList &Inputs,
44 const llvm::opt::ArgList &TCArgs,
45 const char *LinkingOutput) const override;
47 } // end namespace fuchsia
48 } // end namespace tools
50 namespace toolchains {
52 class LLVM_LIBRARY_VISIBILITY Fuchsia : public ToolChain {
53 public:
54 Fuchsia(const Driver &D, const llvm::Triple &Triple,
55 const llvm::opt::ArgList &Args);
57 bool HasNativeLLVMSupport() const override { return true; }
58 bool IsMathErrnoDefault() const override { return false; }
59 RuntimeLibType GetDefaultRuntimeLibType() const override {
60 return ToolChain::RLT_CompilerRT;
62 CXXStdlibType GetDefaultCXXStdlibType() const override {
63 return ToolChain::CST_Libcxx;
65 UnwindTableLevel
66 getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override {
67 return UnwindTableLevel::Asynchronous;
69 bool isPICDefault() const override { return false; }
70 bool isPIEDefault(const llvm::opt::ArgList &Args) const override {
71 return true;
73 bool isPICDefaultForced() const override { return false; }
74 llvm::DebuggerKind getDefaultDebuggerTuning() const override {
75 return llvm::DebuggerKind::GDB;
78 LangOptions::StackProtectorMode
79 GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
80 return LangOptions::SSPStrong;
83 std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
84 types::ID InputType) const override;
86 SanitizerMask getSupportedSanitizers() const override;
87 SanitizerMask getDefaultSanitizers() const override;
89 RuntimeLibType
90 GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
91 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
93 bool IsAArch64OutlineAtomicsDefault(
94 const llvm::opt::ArgList &Args) const override {
95 return true;
98 void
99 addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
100 llvm::opt::ArgStringList &CC1Args,
101 Action::OffloadKind DeviceOffloadKind) const override;
102 void
103 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
104 llvm::opt::ArgStringList &CC1Args) const override;
105 void AddClangCXXStdlibIncludeArgs(
106 const llvm::opt::ArgList &DriverArgs,
107 llvm::opt::ArgStringList &CC1Args) const override;
108 void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
109 llvm::opt::ArgStringList &CmdArgs) const override;
111 const char *getDefaultLinker() const override { return "ld.lld"; }
113 protected:
114 Tool *buildLinker() const override;
115 Tool *buildStaticLibTool() const override;
118 } // end namespace toolchains
119 } // end namespace driver
120 } // end namespace clang
122 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H