Solaris.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SOLARIS_H
  9. #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SOLARIS_H
  10. #include "Gnu.h"
  11. #include "clang/Driver/Tool.h"
  12. #include "clang/Driver/ToolChain.h"
  13. namespace clang {
  14. namespace driver {
  15. namespace tools {
  16. /// solaris -- Directly call Solaris assembler and linker
  17. namespace solaris {
  18. class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
  19. public:
  20. Assembler(const ToolChain &TC)
  21. : Tool("solaris::Assembler", "assembler", 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("solaris::Linker", "linker", 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 solaris
  39. } // end namespace tools
  40. namespace toolchains {
  41. class LLVM_LIBRARY_VISIBILITY Solaris : public Generic_ELF {
  42. public:
  43. Solaris(const Driver &D, const llvm::Triple &Triple,
  44. const llvm::opt::ArgList &Args);
  45. void
  46. AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
  47. llvm::opt::ArgStringList &CC1Args) const override;
  48. void
  49. addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
  50. llvm::opt::ArgStringList &CC1Args) const override;
  51. SanitizerMask getSupportedSanitizers() const override;
  52. unsigned GetDefaultDwarfVersion() const override { return 2; }
  53. const char *getDefaultLinker() const override {
  54. // clang currently uses Solaris ld-only options.
  55. return "/usr/bin/ld";
  56. }
  57. protected:
  58. Tool *buildAssembler() const override;
  59. Tool *buildLinker() const override;
  60. };
  61. } // end namespace toolchains
  62. } // end namespace driver
  63. } // end namespace clang
  64. #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SOLARIS_H