NetBSD.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //===--- NetBSD.h - NetBSD 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_NETBSD_H
  9. #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_NETBSD_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. /// netbsd -- Directly call GNU Binutils assembler and linker
  17. namespace netbsd {
  18. class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
  19. public:
  20. Assembler(const ToolChain &TC) : Tool("netbsd::Assembler", "assembler", TC) {}
  21. bool hasIntegratedCPP() const override { return false; }
  22. void ConstructJob(Compilation &C, const JobAction &JA,
  23. const InputInfo &Output, const InputInfoList &Inputs,
  24. const llvm::opt::ArgList &TCArgs,
  25. const char *LinkingOutput) const override;
  26. };
  27. class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
  28. public:
  29. Linker(const ToolChain &TC) : Tool("netbsd::Linker", "linker", TC) {}
  30. bool hasIntegratedCPP() const override { return false; }
  31. bool isLinkJob() const override { return true; }
  32. void ConstructJob(Compilation &C, const JobAction &JA,
  33. const InputInfo &Output, const InputInfoList &Inputs,
  34. const llvm::opt::ArgList &TCArgs,
  35. const char *LinkingOutput) const override;
  36. };
  37. } // end namespace netbsd
  38. } // end namespace tools
  39. namespace toolchains {
  40. class LLVM_LIBRARY_VISIBILITY NetBSD : public Generic_ELF {
  41. public:
  42. NetBSD(const Driver &D, const llvm::Triple &Triple,
  43. const llvm::opt::ArgList &Args);
  44. bool IsMathErrnoDefault() const override { return false; }
  45. bool IsObjCNonFragileABIDefault() const override { return true; }
  46. CXXStdlibType GetDefaultCXXStdlibType() const override;
  47. void addLibCxxIncludePaths(
  48. const llvm::opt::ArgList &DriverArgs,
  49. llvm::opt::ArgStringList &CC1Args) const override;
  50. void addLibStdCxxIncludePaths(
  51. const llvm::opt::ArgList &DriverArgs,
  52. llvm::opt::ArgStringList &CC1Args) const override;
  53. bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override {
  54. return true;
  55. }
  56. llvm::ExceptionHandling GetExceptionModel(
  57. const llvm::opt::ArgList &Args) const override;
  58. SanitizerMask getSupportedSanitizers() const override;
  59. void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
  60. llvm::opt::ArgStringList &CC1Args,
  61. Action::OffloadKind DeviceOffloadKind) const override;
  62. protected:
  63. Tool *buildAssembler() const override;
  64. Tool *buildLinker() const override;
  65. };
  66. } // end namespace toolchains
  67. } // end namespace driver
  68. } // end namespace clang
  69. #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_NETBSD_H