clang 8.0.0

Fuchsia.h
Go to the documentation of this file.
1 //===--- Fuchsia.h - Fuchsia ToolChain Implementations ----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H
12
13 #include "Gnu.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 GnuTool {
22 public:
23 Linker(const ToolChain &TC) : GnuTool("fuchsia::Linker", "ld.lld", TC) {}
24
25 bool hasIntegratedCPP() const override { return false; }
26 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 bool HasNativeLLVMSupport() const override { return true; }
44 bool IsIntegratedAssemblerDefault() const override { return true; }
45 bool IsMathErrnoDefault() const override { return false; }
46 bool useRelaxRelocations() const override { return true; };
47 RuntimeLibType GetDefaultRuntimeLibType() const override {
48 return ToolChain::RLT_CompilerRT;
49 }
50 CXXStdlibType GetDefaultCXXStdlibType() const override {
51 return ToolChain::CST_Libcxx;
52 }
53 bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override {
54 return true;
55 }
56 bool isPICDefault() const override { return false; }
57 bool isPIEDefault() const override { return true; }
58 bool isPICDefaultForced() const override { return false; }
59 llvm::DebuggerKind getDefaultDebuggerTuning() const override {
60 return llvm::DebuggerKind::GDB;
61 }
62
63 unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
64 return 2; // SSPStrong
65 }
66
67 std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
68 types::ID InputType) const override;
69
70 SanitizerMask getSupportedSanitizers() const override;
71 SanitizerMask getDefaultSanitizers() const override;
72
73 RuntimeLibType
74 GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
75 CXXStdlibType
76 GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
77
78 void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
79 llvm::opt::ArgStringList &CC1Args,
80 Action::OffloadKind DeviceOffloadKind) const override;
81 void
82 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
83 llvm::opt::ArgStringList &CC1Args) const override;
84 void
85 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
86 llvm::opt::ArgStringList &CC1Args) const override;
87 void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
88 llvm::opt::ArgStringList &CmdArgs) const override;
89
90 const char *getDefaultLinker() const override {
91 return "ld.lld";
92 }
93
94 protected:
95 Tool *buildLinker() const override;
96 };
97
98 } // end namespace toolchains
99 } // end namespace driver
100 } // end namespace clang
101
102 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H
Tool.h
clang::driver::types::ID
ID
Definition: Types.h:22
clang::driver::toolchains::Fuchsia::GetDefaultRuntimeLibType
RuntimeLibType GetDefaultRuntimeLibType() const override
GetDefaultRuntimeLibType - Get the default runtime library variant to use.
Definition: Fuchsia.h:47
clang::driver::toolchains::Fuchsia
Definition: Fuchsia.h:38
clang::driver::ToolChain::CXXStdlibType
CXXStdlibType
Definition: ToolChain.h:93
clang::driver::toolchains::Fuchsia::IsIntegratedAssemblerDefault
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: Fuchsia.h:44
clang::driver::JobAction
Definition: Action.h:374
clang::driver::ToolChain::CST_Libcxx
Definition: ToolChain.h:94
clang::driver::toolchains::Fuchsia::GetDefaultStackProtectorLevel
unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override
GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain (0=off...
Definition: Fuchsia.h:63
clang::driver::toolchains::Fuchsia::getDefaultLinker
const char * getDefaultLinker() const override
GetDefaultLinker - Get the default linker to use.
Definition: Fuchsia.h:90
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
clang::driver::ToolChain::RuntimeLibType
RuntimeLibType
Definition: ToolChain.h:98
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:58
clang::driver::toolchains::Fuchsia::isPICDefaultForced
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition: Fuchsia.h:58
clang::driver::toolchains::Fuchsia::getDefaultDebuggerTuning
llvm::DebuggerKind getDefaultDebuggerTuning() const override
Definition: Fuchsia.h:59
clang::driver::tools::fuchsia::Linker::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: Fuchsia.h:25
clang::driver::tools::fuchsia::Linker
Definition: Fuchsia.h:21
clang::driver::tools::fuchsia::Linker::isLinkJob
bool isLinkJob() const override
Definition: Fuchsia.h:26
clang::driver::tools::GnuTool
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:41
clang::driver::toolchains::Fuchsia::useRelaxRelocations
bool useRelaxRelocations() const override
Check whether to enable x86 relax relocations by default.
Definition: Fuchsia.h:46
ToolChain.h
llvm::SmallVector
Definition: LLVM.h:36
Gnu.h
clang::driver::ToolChain::RLT_CompilerRT
Definition: ToolChain.h:99
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:83
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
clang::SanitizerMask
uint64_t SanitizerMask
Definition: Sanitizers.h:26
clang::driver::tools::fuchsia::Linker::Linker
Linker(const ToolChain &TC)
Definition: Fuchsia.h:23
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:46
clang::driver::toolchains::Fuchsia::IsUnwindTablesDefault
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override
IsUnwindTablesDefault - Does this tool chain use -funwind-tables by default.
Definition: Fuchsia.h:53
clang::driver::toolchains::Fuchsia::IsMathErrnoDefault
bool IsMathErrnoDefault() const override
IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
Definition: Fuchsia.h:45
clang::driver::toolchains::Fuchsia::isPIEDefault
bool isPIEDefault() const override
Test whether this toolchain defaults to PIE.
Definition: Fuchsia.h:57
clang::driver::toolchains::Fuchsia::GetDefaultCXXStdlibType
CXXStdlibType GetDefaultCXXStdlibType() const override
Definition: Fuchsia.h:50
clang::driver::toolchains::Fuchsia::isPICDefault
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition: Fuchsia.h:56
clang::driver::toolchains::Fuchsia::HasNativeLLVMSupport
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition: Fuchsia.h:43
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:89