Linux.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //===--- Linux.h - Linux 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_LINUX_H
  9. #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LINUX_H
  10. #include "Gnu.h"
  11. #include "clang/Driver/ToolChain.h"
  12. namespace clang {
  13. namespace driver {
  14. namespace toolchains {
  15. class LLVM_LIBRARY_VISIBILITY Linux : public Generic_ELF {
  16. public:
  17. Linux(const Driver &D, const llvm::Triple &Triple,
  18. const llvm::opt::ArgList &Args);
  19. bool HasNativeLLVMSupport() const override;
  20. std::string getMultiarchTriple(const Driver &D,
  21. const llvm::Triple &TargetTriple,
  22. StringRef SysRoot) const override;
  23. void
  24. AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
  25. llvm::opt::ArgStringList &CC1Args) const override;
  26. void addLibStdCxxIncludePaths(
  27. const llvm::opt::ArgList &DriverArgs,
  28. llvm::opt::ArgStringList &CC1Args) const override;
  29. void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
  30. llvm::opt::ArgStringList &CC1Args) const override;
  31. void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs,
  32. llvm::opt::ArgStringList &CC1Args) const override;
  33. void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
  34. llvm::opt::ArgStringList &CC1Args) const override;
  35. RuntimeLibType GetDefaultRuntimeLibType() const override;
  36. unsigned GetDefaultDwarfVersion() const override;
  37. CXXStdlibType GetDefaultCXXStdlibType() const override;
  38. bool
  39. IsAArch64OutlineAtomicsDefault(const llvm::opt::ArgList &Args) const override;
  40. bool isPIEDefault(const llvm::opt::ArgList &Args) const override;
  41. bool IsMathErrnoDefault() const override;
  42. SanitizerMask getSupportedSanitizers() const override;
  43. void addProfileRTLibs(const llvm::opt::ArgList &Args,
  44. llvm::opt::ArgStringList &CmdArgs) const override;
  45. std::string computeSysRoot() const override;
  46. std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override;
  47. void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override;
  48. std::vector<std::string> ExtraOpts;
  49. llvm::DenormalMode getDefaultDenormalModeForType(
  50. const llvm::opt::ArgList &DriverArgs, const JobAction &JA,
  51. const llvm::fltSemantics *FPType = nullptr) const override;
  52. protected:
  53. Tool *buildAssembler() const override;
  54. Tool *buildLinker() const override;
  55. Tool *buildStaticLibTool() const override;
  56. };
  57. } // end namespace toolchains
  58. } // end namespace driver
  59. } // end namespace clang
  60. #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LINUX_H