1e5dd7070Spatrick //===--- CrossWindows.h - CrossWindows ToolChain Implementation -*- C++ -*-===//
2e5dd7070Spatrick //
3e5dd7070Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e5dd7070Spatrick // See https://llvm.org/LICENSE.txt for license information.
5e5dd7070Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6e5dd7070Spatrick //
7e5dd7070Spatrick //===----------------------------------------------------------------------===//
8e5dd7070Spatrick 
9e5dd7070Spatrick #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
10e5dd7070Spatrick #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
11e5dd7070Spatrick 
12e5dd7070Spatrick #include "Cuda.h"
13e5dd7070Spatrick #include "Gnu.h"
14a9ac8606Spatrick #include "clang/Basic/LangOptions.h"
15e5dd7070Spatrick #include "clang/Driver/Tool.h"
16e5dd7070Spatrick #include "clang/Driver/ToolChain.h"
17e5dd7070Spatrick 
18e5dd7070Spatrick namespace clang {
19e5dd7070Spatrick namespace driver {
20e5dd7070Spatrick namespace tools {
21e5dd7070Spatrick 
22e5dd7070Spatrick namespace CrossWindows {
23e5dd7070Spatrick class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
24e5dd7070Spatrick public:
Assembler(const ToolChain & TC)25e5dd7070Spatrick   Assembler(const ToolChain &TC) : Tool("CrossWindows::Assembler", "as", TC) {}
26e5dd7070Spatrick 
hasIntegratedCPP()27e5dd7070Spatrick   bool hasIntegratedCPP() const override { return false; }
28e5dd7070Spatrick 
29e5dd7070Spatrick   void ConstructJob(Compilation &C, const JobAction &JA,
30e5dd7070Spatrick                     const InputInfo &Output, const InputInfoList &Inputs,
31e5dd7070Spatrick                     const llvm::opt::ArgList &TCArgs,
32e5dd7070Spatrick                     const char *LinkingOutput) const override;
33e5dd7070Spatrick };
34e5dd7070Spatrick 
35e5dd7070Spatrick class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
36e5dd7070Spatrick public:
Linker(const ToolChain & TC)37ec727ea7Spatrick   Linker(const ToolChain &TC) : Tool("CrossWindows::Linker", "ld", TC) {}
38e5dd7070Spatrick 
hasIntegratedCPP()39e5dd7070Spatrick   bool hasIntegratedCPP() const override { return false; }
isLinkJob()40e5dd7070Spatrick   bool isLinkJob() const override { return true; }
41e5dd7070Spatrick 
42e5dd7070Spatrick   void ConstructJob(Compilation &C, const JobAction &JA,
43e5dd7070Spatrick                     const InputInfo &Output, const InputInfoList &Inputs,
44e5dd7070Spatrick                     const llvm::opt::ArgList &TCArgs,
45e5dd7070Spatrick                     const char *LinkingOutput) const override;
46e5dd7070Spatrick };
47e5dd7070Spatrick } // end namespace CrossWindows
48e5dd7070Spatrick } // end namespace tools
49e5dd7070Spatrick 
50e5dd7070Spatrick namespace toolchains {
51e5dd7070Spatrick 
52e5dd7070Spatrick class LLVM_LIBRARY_VISIBILITY CrossWindowsToolChain : public Generic_GCC {
53e5dd7070Spatrick public:
54e5dd7070Spatrick   CrossWindowsToolChain(const Driver &D, const llvm::Triple &T,
55e5dd7070Spatrick                         const llvm::opt::ArgList &Args);
56e5dd7070Spatrick 
IsIntegratedAssemblerDefault()57e5dd7070Spatrick   bool IsIntegratedAssemblerDefault() const override { return true; }
58*12c85518Srobert   UnwindTableLevel
59*12c85518Srobert   getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override;
60e5dd7070Spatrick   bool isPICDefault() const override;
61*12c85518Srobert   bool isPIEDefault(const llvm::opt::ArgList &Args) const override;
62e5dd7070Spatrick   bool isPICDefaultForced() const override;
63e5dd7070Spatrick 
64a9ac8606Spatrick   LangOptions::StackProtectorMode
GetDefaultStackProtectorLevel(bool KernelOrKext)65a9ac8606Spatrick   GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
66a9ac8606Spatrick     return LangOptions::SSPOff;
67e5dd7070Spatrick   }
68e5dd7070Spatrick 
69e5dd7070Spatrick   void
70e5dd7070Spatrick   AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
71e5dd7070Spatrick                             llvm::opt::ArgStringList &CC1Args) const override;
72e5dd7070Spatrick   void AddClangCXXStdlibIncludeArgs(
73e5dd7070Spatrick       const llvm::opt::ArgList &DriverArgs,
74e5dd7070Spatrick       llvm::opt::ArgStringList &CC1Args) const override;
75e5dd7070Spatrick   void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
76e5dd7070Spatrick                            llvm::opt::ArgStringList &CmdArgs) const override;
77e5dd7070Spatrick 
78e5dd7070Spatrick   SanitizerMask getSupportedSanitizers() const override;
79e5dd7070Spatrick 
80e5dd7070Spatrick protected:
81e5dd7070Spatrick   Tool *buildLinker() const override;
82e5dd7070Spatrick   Tool *buildAssembler() const override;
83e5dd7070Spatrick };
84e5dd7070Spatrick 
85e5dd7070Spatrick } // end namespace toolchains
86e5dd7070Spatrick } // end namespace driver
87e5dd7070Spatrick } // end namespace clang
88e5dd7070Spatrick 
89e5dd7070Spatrick #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
90