clang  14.0.0git
PS4CPU.h
Go to the documentation of this file.
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"
14 #include "clang/Driver/Tool.h"
15 #include "clang/Driver/ToolChain.h"
16 
17 namespace clang {
18 namespace driver {
19 namespace tools {
20 
21 namespace PS4cpu {
22 
23 void addProfileRTArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
24  llvm::opt::ArgStringList &CmdArgs);
25 
26 void addSanitizerArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
27  llvm::opt::ArgStringList &CmdArgs);
28 
29 class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
30 public:
31  Assemble(const ToolChain &TC) : Tool("PS4cpu::Assemble", "assembler", TC) {}
32 
33  bool hasIntegratedCPP() const override { return false; }
34 
35  void ConstructJob(Compilation &C, const JobAction &JA,
36  const InputInfo &Output,
37  const InputInfoList &Inputs,
38  const llvm::opt::ArgList &TCArgs,
39  const char *LinkingOutput) const override;
40 };
41 
42 class LLVM_LIBRARY_VISIBILITY Link : public Tool {
43 public:
44  Link(const ToolChain &TC) : Tool("PS4cpu::Link", "linker", TC) {}
45 
46  bool hasIntegratedCPP() const override { return false; }
47  bool isLinkJob() const override { return true; }
48 
49  void ConstructJob(Compilation &C, const JobAction &JA,
50  const InputInfo &Output,
51  const InputInfoList &Inputs,
52  const llvm::opt::ArgList &TCArgs,
53  const char *LinkingOutput) const override;
54 };
55 } // end namespace PS4cpu
56 } // namespace tools
57 
58 namespace toolchains {
59 
60 class LLVM_LIBRARY_VISIBILITY PS4CPU : public Generic_ELF {
61 public:
62  PS4CPU(const Driver &D, const llvm::Triple &Triple,
63  const llvm::opt::ArgList &Args);
64 
65  // No support for finding a C++ standard library yet.
67  const llvm::opt::ArgList &DriverArgs,
68  llvm::opt::ArgStringList &CC1Args) const override {}
70  const llvm::opt::ArgList &DriverArgs,
71  llvm::opt::ArgStringList &CC1Args) const override {}
72 
73  bool IsMathErrnoDefault() const override { return false; }
74  bool IsObjCNonFragileABIDefault() const override { return true; }
75  bool HasNativeLLVMSupport() const override;
76  bool isPICDefault() const override;
77 
79  GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
81  }
82 
83  unsigned GetDefaultDwarfVersion() const override { return 4; }
84  llvm::DebuggerKind getDefaultDebuggerTuning() const override {
85  return llvm::DebuggerKind::SCE;
86  }
87 
88  SanitizerMask getSupportedSanitizers() const override;
89 
90  // PS4 toolchain uses legacy thin LTO API, which is not
91  // capable of unit splitting.
92  bool canSplitThinLTOUnit() const override { return false; }
93 
94  void addClangTargetOptions(
95  const llvm::opt::ArgList &DriverArgs,
96  llvm::opt::ArgStringList &CC1Args,
97  Action::OffloadKind DeviceOffloadingKind) const override;
98 
99  llvm::DenormalMode getDefaultDenormalModeForType(
100  const llvm::opt::ArgList &DriverArgs, const JobAction &JA,
101  const llvm::fltSemantics *FPType) const override {
102  // DAZ and FTZ are on by default.
103  return llvm::DenormalMode::getPreserveSign();
104  }
105 
106  bool useRelaxRelocations() const override { return true; }
107 
108 protected:
109  Tool *buildAssembler() const override;
110  Tool *buildLinker() const override;
111 };
112 
113 } // end namespace toolchains
114 } // end namespace driver
115 } // end namespace clang
116 
117 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_PS4CPU_H
clang::LangOptions::StackProtectorMode
StackProtectorMode
Definition: LangOptions.h:64
clang::driver::toolchains::PS4CPU::getDefaultDenormalModeForType
llvm::DenormalMode getDefaultDenormalModeForType(const llvm::opt::ArgList &DriverArgs, const JobAction &JA, const llvm::fltSemantics *FPType) const override
Returns the output denormal handling type in the default floating point environment for the given FPT...
Definition: PS4CPU.h:99
clang::LangOptions::SSPStrong
@ SSPStrong
Definition: LangOptions.h:64
llvm::SmallVector
Definition: LLVM.h:38
clang::driver::toolchains::PS4CPU::GetDefaultStackProtectorLevel
LangOptions::StackProtectorMode GetDefaultStackProtectorLevel(bool KernelOrKext) const override
GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain.
Definition: PS4CPU.h:79
clang::driver::toolchains::PS4CPU::useRelaxRelocations
bool useRelaxRelocations() const override
Check whether to enable x86 relax relocations by default.
Definition: PS4CPU.h:106
clang::driver::toolchains::PS4CPU::IsMathErrnoDefault
bool IsMathErrnoDefault() const override
IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
Definition: PS4CPU.h:73
clang::driver::tools::PS4cpu::Assemble::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: PS4CPU.h:33
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::toolchains::PS4CPU::addLibCxxIncludePaths
void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: PS4CPU.h:66
clang::driver::toolchains::PS4CPU::canSplitThinLTOUnit
bool canSplitThinLTOUnit() const override
Returns true when it's possible to split LTO unit to use whole program devirtualization and CFI santi...
Definition: PS4CPU.h:92
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:362
clang::driver::tools::PS4cpu::addProfileRTArgs
void addProfileRTArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
LangOptions.h
clang::driver::toolchains::PS4CPU::addLibStdCxxIncludePaths
void addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: PS4CPU.h:69
Tool.h
clang::driver::tools::PS4cpu::Assemble
Definition: PS4CPU.h:29
ToolChain.h
Gnu.h
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:91
clang::driver::toolchains::PS4CPU::GetDefaultDwarfVersion
unsigned GetDefaultDwarfVersion() const override
Definition: PS4CPU.h:83
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang::driver::toolchains::PS4CPU
Definition: PS4CPU.h:60
clang::driver::toolchains::PS4CPU::getDefaultDebuggerTuning
llvm::DebuggerKind getDefaultDebuggerTuning() const override
Definition: PS4CPU.h:84
clang
Definition: CalledOnceCheck.h:17
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
clang::driver::toolchains::PS4CPU::IsObjCNonFragileABIDefault
bool IsObjCNonFragileABIDefault() const override
IsObjCNonFragileABIDefault - Does this tool chain set -fobjc-nonfragile-abi by default.
Definition: PS4CPU.h:74
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:85
clang::driver::JobAction
Definition: Action.h:380
clang::driver::tools::PS4cpu::addSanitizerArgs
void addSanitizerArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::tools::PS4cpu::Assemble::Assemble
Assemble(const ToolChain &TC)
Definition: PS4CPU.h:31
clang::SanitizerMask
Definition: Sanitizers.h:30