9#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AMDGPU_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AMDGPU_H
17#include "llvm/ADT/SmallString.h"
18#include "llvm/TargetParser/TargetParser.h"
28class LLVM_LIBRARY_VISIBILITY
Linker final :
public Tool {
35 const llvm::opt::ArgList &TCArgs,
36 const char *LinkingOutput)
const override;
40 const llvm::opt::ArgList &Args,
41 std::vector<StringRef> &Features);
44 llvm::opt::ArgStringList &CmdArgs);
63 const llvm::opt::ArgList &Args);
75 llvm::opt::DerivedArgList *
76 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
79 void addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
80 llvm::opt::ArgStringList &CC1Args,
83 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
84 llvm::opt::ArgStringList &CC1Args)
const override;
88 static bool getDefaultDenormsAreZeroForTarget(llvm::AMDGPU::GPUKind GPUKind);
90 llvm::DenormalMode getDefaultDenormalModeForType(
91 const llvm::opt::ArgList &DriverArgs,
const JobAction &JA,
92 const llvm::fltSemantics *FPType =
nullptr)
const override;
94 static bool isWave64(
const llvm::opt::ArgList &DriverArgs,
95 llvm::AMDGPU::GPUKind Kind);
105 bool shouldSkipSanitizeOption(
const ToolChain &TC,
106 const llvm::opt::ArgList &DriverArgs,
108 const llvm::opt::Arg *A)
const;
113 getSystemGPUArchs(
const llvm::opt::ArgList &Args)
const override;
117 virtual void checkTargetID(
const llvm::opt::ArgList &DriverArgs)
const;
132 StringRef
getGPUArch(
const llvm::opt::ArgList &DriverArgs)
const;
142 const llvm::opt::ArgList &Args);
145 llvm::opt::ArgStringList &CC1Args,
151 const std::string &GPUArch,
155 return SanitizerKind::Address;
159 const llvm::opt::DerivedArgList &DAL,
160 const llvm::opt::ArgList &DriverArgs,
161 const char *
Value =
nullptr)
const {
163 bool IsExplicitDevice =
164 A->getBaseArg().getOption().matches(options::OPT_Xarch_device);
169 ? clang::diag::err_drv_unsupported_option_part_for_target
170 : clang::diag::warn_drv_unsupported_option_part_for_target;
171 Diags.Report(DiagID) <<
Value << A->getAsString(DriverArgs)
176 ? clang::diag::err_drv_unsupported_option_for_target
177 : clang::diag::warn_drv_unsupported_option_for_target;
178 Diags.Report(DiagID) << A->getAsString(DAL) <<
getTriple().str();
184 const llvm::opt::ArgList &DriverArgs,
185 StringRef TargetID,
const llvm::opt::Arg *A)
const {
186 if (TargetID.empty())
189 if (!DriverArgs.hasFlag(options::OPT_fgpu_sanitize,
190 options::OPT_fno_gpu_sanitize,
true))
192 const llvm::opt::Option &Opt = A->getOption();
195 if (Opt.matches(options::OPT_fsan_cov_Group)) {
199 if (!Opt.matches(options::OPT_fsanitize_EQ))
205 for (
const char *
Value : A->getValues()) {
208 SupportedSanitizers.push_back(
Value);
210 UnSupportedSanitizers.push_back(
Value);
214 if (SupportedSanitizers.empty()) {
219 if (!UnSupportedSanitizers.empty()) {
220 for (
const char *
Value : UnSupportedSanitizers) {
229 DAL.AddJoinedArg(A, A->getOption(), llvm::join(SupportedSanitizers,
","));
Compilation - A set of tasks to perform for a single driver invocation.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
SmallVector< InputInfo, 4 > InputInfoList
The JSON file list parser is used to communicate input to InstallAPI.
SanitizerMask parseSanitizerValue(StringRef Value, bool AllowGroups)
Parse a single value from a -fsanitize= or -fno-sanitize= value list.