clang  6.0.0svn
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; };
49  }
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  std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
64  types::ID InputType) const override;
65 
66  SanitizerMask getSupportedSanitizers() const override;
67 
69  GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
71  GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
72 
73  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
74  llvm::opt::ArgStringList &CC1Args,
75  Action::OffloadKind DeviceOffloadKind) const override;
76  void
77  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
78  llvm::opt::ArgStringList &CC1Args) const override;
79  void
80  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
81  llvm::opt::ArgStringList &CC1Args) const override;
82  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
83  llvm::opt::ArgStringList &CmdArgs) const override;
84 
85  const char *getDefaultLinker() const override {
86  return "ld.lld";
87  }
88 
89 protected:
90  Tool *buildLinker() const override;
91 };
92 
93 } // end namespace toolchains
94 } // end namespace driver
95 } // end namespace clang
96 
97 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FUCHSIA_H
RuntimeLibType GetDefaultRuntimeLibType() const override
GetDefaultRuntimeLibType - Get the default runtime library variant to use.
Definition: Fuchsia.h:47
bool IsIntegratedAssemblerDefault() const override
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: Fuchsia.h:44
const char * getDefaultLinker() const override
GetDefaultLinker - Get the default linker to use.
Definition: Fuchsia.h:85
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:65
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition: Fuchsia.h:58
llvm::DebuggerKind getDefaultDebuggerTuning() const override
Definition: Fuchsia.h:59
bool hasIntegratedCPP() const override
Definition: Fuchsia.h:25
bool isLinkJob() const override
Definition: Fuchsia.h:26
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:41
bool useRelaxRelocations() const override
Check whether to enable x86 relax relocations by default.
Definition: Fuchsia.h:46
Dataflow Directional Tag Classes.
uint64_t SanitizerMask
Definition: Sanitizers.h:24
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
Linker(const ToolChain &TC)
Definition: Fuchsia.h:23
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:34
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override
IsUnwindTablesDefault - Does this tool chain use -funwind-tables by default.
Definition: Fuchsia.h:53
bool IsMathErrnoDefault() const override
IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
Definition: Fuchsia.h:45
bool isPIEDefault() const override
Test whether this toolchain defaults to PIE.
Definition: Fuchsia.h:57
CXXStdlibType GetDefaultCXXStdlibType() const override
Definition: Fuchsia.h:50
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition: Fuchsia.h:56
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition: Fuchsia.h:43
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:73