xref: /freebsd/contrib/llvm-project/clang/lib/Driver/ToolChains/Solaris.h (revision 6580f5c38dd5b01aeeaed16b370f1a12423437f0)
1 //===--- Solaris.h - Solaris 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_SOLARIS_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SOLARIS_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 
20 /// Directly call Solaris assembler and linker
21 namespace solaris {
22 class LLVM_LIBRARY_VISIBILITY Assembler final : public gnutools::Assembler {
23 public:
24   Assembler(const ToolChain &TC) : gnutools::Assembler(TC) {}
25 
26   bool hasIntegratedCPP() const override { return false; }
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 
34 bool isLinkerGnuLd(const ToolChain &TC, const llvm::opt::ArgList &Args);
35 
36 class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
37 public:
38   Linker(const ToolChain &TC) : Tool("solaris::Linker", "linker", TC) {}
39 
40   bool hasIntegratedCPP() const override { return false; }
41   bool isLinkJob() const override { return true; }
42   std::string getLinkerPath(const llvm::opt::ArgList &Args) const;
43 
44   void ConstructJob(Compilation &C, const JobAction &JA,
45                     const InputInfo &Output, const InputInfoList &Inputs,
46                     const llvm::opt::ArgList &TCArgs,
47                     const char *LinkingOutput) const override;
48 };
49 } // end namespace solaris
50 } // end namespace tools
51 
52 namespace toolchains {
53 
54 class LLVM_LIBRARY_VISIBILITY Solaris : public Generic_ELF {
55 public:
56   Solaris(const Driver &D, const llvm::Triple &Triple,
57           const llvm::opt::ArgList &Args);
58 
59   void
60   AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
61                             llvm::opt::ArgStringList &CC1Args) const override;
62 
63   void
64   addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
65                            llvm::opt::ArgStringList &CC1Args) const override;
66 
67   SanitizerMask getSupportedSanitizers() const override;
68 
69   const char *getDefaultLinker() const override;
70 
71 protected:
72   Tool *buildAssembler() const override;
73   Tool *buildLinker() const override;
74 };
75 
76 } // end namespace toolchains
77 } // end namespace driver
78 } // end namespace clang
79 
80 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SOLARIS_H
81