CrossWindows.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //===--- CrossWindows.h - CrossWindows ToolChain Implementation -*- 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. #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
  9. #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H
  10. #include "Cuda.h"
  11. #include "Gnu.h"
  12. #include "clang/Basic/LangOptions.h"
  13. #include "clang/Driver/Tool.h"
  14. #include "clang/Driver/ToolChain.h"
  15. namespace clang {
  16. namespace driver {
  17. namespace tools {
  18. namespace CrossWindows {
  19. class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
  20. public:
  21. Assembler(const ToolChain &TC) : Tool("CrossWindows::Assembler", "as", TC) {}
  22. bool hasIntegratedCPP() const override { return false; }
  23. void ConstructJob(Compilation &C, const JobAction &JA,
  24. const InputInfo &Output, const InputInfoList &Inputs,
  25. const llvm::opt::ArgList &TCArgs,
  26. const char *LinkingOutput) const override;
  27. };
  28. class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
  29. public:
  30. Linker(const ToolChain &TC) : Tool("CrossWindows::Linker", "ld", TC) {}
  31. bool hasIntegratedCPP() const override { return false; }
  32. bool isLinkJob() const override { return true; }
  33. void ConstructJob(Compilation &C, const JobAction &JA,
  34. const InputInfo &Output, const InputInfoList &Inputs,
  35. const llvm::opt::ArgList &TCArgs,
  36. const char *LinkingOutput) const override;
  37. };
  38. } // end namespace CrossWindows
  39. } // end namespace tools
  40. namespace toolchains {
  41. class LLVM_LIBRARY_VISIBILITY CrossWindowsToolChain : public Generic_GCC {
  42. public:
  43. CrossWindowsToolChain(const Driver &D, const llvm::Triple &T,
  44. const llvm::opt::ArgList &Args);
  45. bool IsIntegratedAssemblerDefault() const override { return true; }
  46. bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override;
  47. bool isPICDefault() const override;
  48. bool isPIEDefault(const llvm::opt::ArgList &Args) const override;
  49. bool isPICDefaultForced() const override;
  50. LangOptions::StackProtectorMode
  51. GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
  52. return LangOptions::SSPOff;
  53. }
  54. void
  55. AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
  56. llvm::opt::ArgStringList &CC1Args) const override;
  57. void AddClangCXXStdlibIncludeArgs(
  58. const llvm::opt::ArgList &DriverArgs,
  59. llvm::opt::ArgStringList &CC1Args) const override;
  60. void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
  61. llvm::opt::ArgStringList &CmdArgs) const override;
  62. SanitizerMask getSupportedSanitizers() const override;
  63. protected:
  64. Tool *buildLinker() const override;
  65. Tool *buildAssembler() const override;
  66. };
  67. } // end namespace toolchains
  68. } // end namespace driver
  69. } // end namespace clang
  70. #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CROSSWINDOWS_H