AIX.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //===--- AIX.h - AIX 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_AIX_H
  9. #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AIX_H
  10. #include "clang/Driver/Tool.h"
  11. #include "clang/Driver/ToolChain.h"
  12. namespace clang {
  13. namespace driver {
  14. namespace tools {
  15. /// aix -- Directly call system default assembler and linker.
  16. namespace aix {
  17. class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
  18. public:
  19. Assembler(const ToolChain &TC) : Tool("aix::Assembler", "assembler", TC) {}
  20. bool hasIntegratedCPP() const override { return false; }
  21. void ConstructJob(Compilation &C, const JobAction &JA,
  22. const InputInfo &Output, const InputInfoList &Inputs,
  23. const llvm::opt::ArgList &TCArgs,
  24. const char *LinkingOutput) const override;
  25. };
  26. class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
  27. public:
  28. Linker(const ToolChain &TC) : Tool("aix::Linker", "linker", TC) {}
  29. bool hasIntegratedCPP() const override { return false; }
  30. bool isLinkJob() const override { return true; }
  31. void ConstructJob(Compilation &C, const JobAction &JA,
  32. const InputInfo &Output, const InputInfoList &Inputs,
  33. const llvm::opt::ArgList &TCArgs,
  34. const char *LinkingOutput) const override;
  35. };
  36. } // end namespace aix
  37. } // end namespace tools
  38. } // end namespace driver
  39. } // end namespace clang
  40. namespace clang {
  41. namespace driver {
  42. namespace toolchains {
  43. class LLVM_LIBRARY_VISIBILITY AIX : public ToolChain {
  44. public:
  45. AIX(const Driver &D, const llvm::Triple &Triple,
  46. const llvm::opt::ArgList &Args);
  47. bool parseInlineAsmUsingAsmParser() const override {
  48. return ParseInlineAsmUsingAsmParser;
  49. }
  50. bool isPICDefault() const override { return true; }
  51. bool isPIEDefault(const llvm::opt::ArgList &Args) const override {
  52. return false;
  53. }
  54. bool isPICDefaultForced() const override { return true; }
  55. void
  56. AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
  57. llvm::opt::ArgStringList &CC1Args) const override;
  58. void AddClangCXXStdlibIncludeArgs(
  59. const llvm::opt::ArgList &DriverArgs,
  60. llvm::opt::ArgStringList &CC1Args) const override;
  61. void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
  62. llvm::opt::ArgStringList &CmdArgs) const override;
  63. CXXStdlibType GetDefaultCXXStdlibType() const override;
  64. RuntimeLibType GetDefaultRuntimeLibType() const override;
  65. // Set default DWARF version to 3 for now as latest AIX OS supports version 3.
  66. unsigned GetDefaultDwarfVersion() const override { return 3; }
  67. llvm::DebuggerKind getDefaultDebuggerTuning() const override {
  68. return llvm::DebuggerKind::DBX;
  69. }
  70. protected:
  71. Tool *buildAssembler() const override;
  72. Tool *buildLinker() const override;
  73. private:
  74. llvm::StringRef GetHeaderSysroot(const llvm::opt::ArgList &DriverArgs) const;
  75. bool ParseInlineAsmUsingAsmParser;
  76. };
  77. } // end namespace toolchains
  78. } // end namespace driver
  79. } // end namespace clang
  80. #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AIX_H