1 //===--- PS4CPU.h - PS4CPU 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 9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_PS4CPU_H 10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_PS4CPU_H 11 12 #include "Gnu.h" 13 #include "clang/Driver/Tool.h" 14 #include "clang/Driver/ToolChain.h" 15 16 namespace clang { 17 namespace driver { 18 namespace tools { 19 20 namespace PS4cpu { 21 22 void addProfileRTArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, 23 llvm::opt::ArgStringList &CmdArgs); 24 25 void addSanitizerArgs(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs); 26 27 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { 28 public: 29 Assemble(const ToolChain &TC) 30 : Tool("PS4cpu::Assemble", "assembler", TC, RF_Full) {} 31 32 bool hasIntegratedCPP() const override { return false; } 33 34 void ConstructJob(Compilation &C, const JobAction &JA, 35 const InputInfo &Output, 36 const InputInfoList &Inputs, 37 const llvm::opt::ArgList &TCArgs, 38 const char *LinkingOutput) const override; 39 }; 40 41 class LLVM_LIBRARY_VISIBILITY Link : public Tool { 42 public: 43 Link(const ToolChain &TC) : Tool("PS4cpu::Link", "linker", TC, RF_Full) {} 44 45 bool hasIntegratedCPP() const override { return false; } 46 bool isLinkJob() const override { return true; } 47 48 void ConstructJob(Compilation &C, const JobAction &JA, 49 const InputInfo &Output, 50 const InputInfoList &Inputs, 51 const llvm::opt::ArgList &TCArgs, 52 const char *LinkingOutput) const override; 53 }; 54 } // end namespace PS4cpu 55 } // namespace tools 56 57 namespace toolchains { 58 59 class LLVM_LIBRARY_VISIBILITY PS4CPU : public Generic_ELF { 60 public: 61 PS4CPU(const Driver &D, const llvm::Triple &Triple, 62 const llvm::opt::ArgList &Args); 63 64 // No support for finding a C++ standard library yet. 65 void addLibCxxIncludePaths( 66 const llvm::opt::ArgList &DriverArgs, 67 llvm::opt::ArgStringList &CC1Args) const override {} 68 void addLibStdCxxIncludePaths( 69 const llvm::opt::ArgList &DriverArgs, 70 llvm::opt::ArgStringList &CC1Args) const override {} 71 72 bool IsMathErrnoDefault() const override { return false; } 73 bool IsObjCNonFragileABIDefault() const override { return true; } 74 bool HasNativeLLVMSupport() const override; 75 bool isPICDefault() const override; 76 77 unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override { 78 return 2; // SSPStrong 79 } 80 81 llvm::DebuggerKind getDefaultDebuggerTuning() const override { 82 return llvm::DebuggerKind::SCE; 83 } 84 85 SanitizerMask getSupportedSanitizers() const override; 86 87 // PS4 toolchain uses legacy thin LTO API, which is not 88 // capable of unit splitting. 89 bool canSplitThinLTOUnit() const override { return false; } 90 91 protected: 92 Tool *buildAssembler() const override; 93 Tool *buildLinker() const override; 94 }; 95 96 } // end namespace toolchains 97 } // end namespace driver 98 } // end namespace clang 99 100 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_PS4CPU_H 101