clang  9.0.0svn
HIP.cpp
Go to the documentation of this file.
1 //===--- HIP.cpp - HIP Tool and 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 #include "HIP.h"
10 #include "CommonArgs.h"
11 #include "InputInfo.h"
12 #include "clang/Basic/Cuda.h"
14 #include "clang/Driver/Driver.h"
16 #include "clang/Driver/Options.h"
17 #include "llvm/Support/FileSystem.h"
18 #include "llvm/Support/Path.h"
19 
20 using namespace clang::driver;
21 using namespace clang::driver::toolchains;
22 using namespace clang::driver::tools;
23 using namespace clang;
24 using namespace llvm::opt;
25 
26 #if _WIN32 || _WIN64
27 #define NULL_FILE "nul"
28 #else
29 #define NULL_FILE "/dev/null"
30 #endif
31 
32 namespace {
33 
34 static void addBCLib(const Driver &D, const ArgList &Args,
35  ArgStringList &CmdArgs, ArgStringList LibraryPaths,
36  StringRef BCName) {
37  StringRef FullName;
38  for (std::string LibraryPath : LibraryPaths) {
39  SmallString<128> Path(LibraryPath);
40  llvm::sys::path::append(Path, BCName);
41  FullName = Path;
42  if (llvm::sys::fs::exists(FullName)) {
43  CmdArgs.push_back("-mlink-builtin-bitcode");
44  CmdArgs.push_back(Args.MakeArgString(FullName));
45  return;
46  }
47  }
48  D.Diag(diag::err_drv_no_such_file) << BCName;
49 }
50 
51 } // namespace
52 
53 const char *AMDGCN::Linker::constructLLVMLinkCommand(
54  Compilation &C, const JobAction &JA, const InputInfoList &Inputs,
55  const ArgList &Args, StringRef SubArchName,
56  StringRef OutputFilePrefix) const {
57  ArgStringList CmdArgs;
58  // Add the input bc's created by compile step.
59  for (const auto &II : Inputs)
60  CmdArgs.push_back(II.getFilename());
61 
62  // Add an intermediate output file.
63  CmdArgs.push_back("-o");
64  std::string TmpName =
65  C.getDriver().GetTemporaryPath(OutputFilePrefix.str() + "-linked", "bc");
66  const char *OutputFileName =
67  C.addTempFile(C.getArgs().MakeArgString(TmpName));
68  CmdArgs.push_back(OutputFileName);
69  SmallString<128> ExecPath(C.getDriver().Dir);
70  llvm::sys::path::append(ExecPath, "llvm-link");
71  const char *Exec = Args.MakeArgString(ExecPath);
72  C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
73  return OutputFileName;
74 }
75 
76 const char *AMDGCN::Linker::constructOptCommand(
77  Compilation &C, const JobAction &JA, const InputInfoList &Inputs,
78  const llvm::opt::ArgList &Args, llvm::StringRef SubArchName,
79  llvm::StringRef OutputFilePrefix, const char *InputFileName) const {
80  // Construct opt command.
81  ArgStringList OptArgs;
82  // The input to opt is the output from llvm-link.
83  OptArgs.push_back(InputFileName);
84  // Pass optimization arg to opt.
85  if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
86  StringRef OOpt = "3";
87  if (A->getOption().matches(options::OPT_O4) ||
88  A->getOption().matches(options::OPT_Ofast))
89  OOpt = "3";
90  else if (A->getOption().matches(options::OPT_O0))
91  OOpt = "0";
92  else if (A->getOption().matches(options::OPT_O)) {
93  // -Os, -Oz, and -O(anything else) map to -O2
94  OOpt = llvm::StringSwitch<const char *>(A->getValue())
95  .Case("1", "1")
96  .Case("2", "2")
97  .Case("3", "3")
98  .Case("s", "2")
99  .Case("z", "2")
100  .Default("2");
101  }
102  OptArgs.push_back(Args.MakeArgString("-O" + OOpt));
103  }
104  OptArgs.push_back("-mtriple=amdgcn-amd-amdhsa");
105  OptArgs.push_back(Args.MakeArgString("-mcpu=" + SubArchName));
106 
107  for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
108  OptArgs.push_back(A->getValue(0));
109  }
110 
111  OptArgs.push_back("-o");
112  std::string TmpFileName = C.getDriver().GetTemporaryPath(
113  OutputFilePrefix.str() + "-optimized", "bc");
114  const char *OutputFileName =
115  C.addTempFile(C.getArgs().MakeArgString(TmpFileName));
116  OptArgs.push_back(OutputFileName);
117  SmallString<128> OptPath(C.getDriver().Dir);
118  llvm::sys::path::append(OptPath, "opt");
119  const char *OptExec = Args.MakeArgString(OptPath);
120  C.addCommand(llvm::make_unique<Command>(JA, *this, OptExec, OptArgs, Inputs));
121  return OutputFileName;
122 }
123 
124 const char *AMDGCN::Linker::constructLlcCommand(
125  Compilation &C, const JobAction &JA, const InputInfoList &Inputs,
126  const llvm::opt::ArgList &Args, llvm::StringRef SubArchName,
127  llvm::StringRef OutputFilePrefix, const char *InputFileName) const {
128  // Construct llc command.
129  ArgStringList LlcArgs{InputFileName, "-mtriple=amdgcn-amd-amdhsa",
130  "-filetype=obj", "-mattr=-code-object-v3",
131  Args.MakeArgString("-mcpu=" + SubArchName)};
132 
133  // Extract all the -m options
134  std::vector<llvm::StringRef> Features;
136  Args, Features, options::OPT_m_amdgpu_Features_Group);
137 
138  // Add features to mattr such as xnack
139  std::string MAttrString = "-mattr=";
140  for(auto OneFeature : Features) {
141  MAttrString.append(Args.MakeArgString(OneFeature));
142  if (OneFeature != Features.back())
143  MAttrString.append(",");
144  }
145  if(!Features.empty())
146  LlcArgs.push_back(Args.MakeArgString(MAttrString));
147 
148  for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
149  LlcArgs.push_back(A->getValue(0));
150  }
151 
152  // Add output filename
153  LlcArgs.push_back("-o");
154  std::string LlcOutputFileName =
155  C.getDriver().GetTemporaryPath(OutputFilePrefix, "o");
156  const char *LlcOutputFile =
157  C.addTempFile(C.getArgs().MakeArgString(LlcOutputFileName));
158  LlcArgs.push_back(LlcOutputFile);
159  SmallString<128> LlcPath(C.getDriver().Dir);
160  llvm::sys::path::append(LlcPath, "llc");
161  const char *Llc = Args.MakeArgString(LlcPath);
162  C.addCommand(llvm::make_unique<Command>(JA, *this, Llc, LlcArgs, Inputs));
163  return LlcOutputFile;
164 }
165 
166 void AMDGCN::Linker::constructLldCommand(Compilation &C, const JobAction &JA,
167  const InputInfoList &Inputs,
168  const InputInfo &Output,
169  const llvm::opt::ArgList &Args,
170  const char *InputFileName) const {
171  // Construct lld command.
172  // The output from ld.lld is an HSA code object file.
173  ArgStringList LldArgs{"-flavor", "gnu", "--no-undefined",
174  "-shared", "-o", Output.getFilename(),
175  InputFileName};
176  SmallString<128> LldPath(C.getDriver().Dir);
177  llvm::sys::path::append(LldPath, "lld");
178  const char *Lld = Args.MakeArgString(LldPath);
179  C.addCommand(llvm::make_unique<Command>(JA, *this, Lld, LldArgs, Inputs));
180 }
181 
182 // Construct a clang-offload-bundler command to bundle code objects for
183 // different GPU's into a HIP fat binary.
185  StringRef OutputFileName, const InputInfoList &Inputs,
186  const llvm::opt::ArgList &Args, const Tool& T) {
187  // Construct clang-offload-bundler command to bundle object files for
188  // for different GPU archs.
189  ArgStringList BundlerArgs;
190  BundlerArgs.push_back(Args.MakeArgString("-type=o"));
191 
192  // ToDo: Remove the dummy host binary entry which is required by
193  // clang-offload-bundler.
194  std::string BundlerTargetArg = "-targets=host-x86_64-unknown-linux";
195  std::string BundlerInputArg = "-inputs=" NULL_FILE;
196 
197  for (const auto &II : Inputs) {
198  const auto* A = II.getAction();
199  BundlerTargetArg = BundlerTargetArg + ",hip-amdgcn-amd-amdhsa-" +
200  StringRef(A->getOffloadingArch()).str();
201  BundlerInputArg = BundlerInputArg + "," + II.getFilename();
202  }
203  BundlerArgs.push_back(Args.MakeArgString(BundlerTargetArg));
204  BundlerArgs.push_back(Args.MakeArgString(BundlerInputArg));
205 
206  auto BundlerOutputArg =
207  Args.MakeArgString(std::string("-outputs=").append(OutputFileName));
208  BundlerArgs.push_back(BundlerOutputArg);
209 
210  SmallString<128> BundlerPath(C.getDriver().Dir);
211  llvm::sys::path::append(BundlerPath, "clang-offload-bundler");
212  const char *Bundler = Args.MakeArgString(BundlerPath);
213  C.addCommand(llvm::make_unique<Command>(JA, T, Bundler, BundlerArgs, Inputs));
214 }
215 
216 // For amdgcn the inputs of the linker job are device bitcode and output is
217 // object file. It calls llvm-link, opt, llc, then lld steps.
218 void AMDGCN::Linker::ConstructJob(Compilation &C, const JobAction &JA,
219  const InputInfo &Output,
220  const InputInfoList &Inputs,
221  const ArgList &Args,
222  const char *LinkingOutput) const {
223 
224  if (JA.getType() == types::TY_HIP_FATBIN)
225  return constructHIPFatbinCommand(C, JA, Output.getFilename(), Inputs, Args, *this);
226 
227  assert(getToolChain().getTriple().getArch() == llvm::Triple::amdgcn &&
228  "Unsupported target");
229 
230  std::string SubArchName = JA.getOffloadingArch();
231  assert(StringRef(SubArchName).startswith("gfx") && "Unsupported sub arch");
232 
233  // Prefix for temporary file name.
234  std::string Prefix =
235  llvm::sys::path::stem(Inputs[0].getFilename()).str() + "-" + SubArchName;
236 
237  // Each command outputs different files.
238  const char *LLVMLinkCommand =
239  constructLLVMLinkCommand(C, JA, Inputs, Args, SubArchName, Prefix);
240  const char *OptCommand = constructOptCommand(C, JA, Inputs, Args, SubArchName,
241  Prefix, LLVMLinkCommand);
242  const char *LlcCommand =
243  constructLlcCommand(C, JA, Inputs, Args, SubArchName, Prefix, OptCommand);
244  constructLldCommand(C, JA, Inputs, Output, Args, LlcCommand);
245 }
246 
247 HIPToolChain::HIPToolChain(const Driver &D, const llvm::Triple &Triple,
248  const ToolChain &HostTC, const ArgList &Args)
249  : ToolChain(D, Triple, Args), HostTC(HostTC) {
250  // Lookup binaries into the driver directory, this is used to
251  // discover the clang-offload-bundler executable.
252  getProgramPaths().push_back(getDriver().Dir);
253 }
254 
256  const llvm::opt::ArgList &DriverArgs,
257  llvm::opt::ArgStringList &CC1Args,
258  Action::OffloadKind DeviceOffloadingKind) const {
259  HostTC.addClangTargetOptions(DriverArgs, CC1Args, DeviceOffloadingKind);
260 
261  StringRef GpuArch = DriverArgs.getLastArgValue(options::OPT_march_EQ);
262  assert(!GpuArch.empty() && "Must have an explicit GPU arch.");
263  (void) GpuArch;
264  assert(DeviceOffloadingKind == Action::OFK_HIP &&
265  "Only HIP offloading kinds are supported for GPUs.");
266 
267  CC1Args.push_back("-target-cpu");
268  CC1Args.push_back(DriverArgs.MakeArgStringRef(GpuArch));
269  CC1Args.push_back("-fcuda-is-device");
270 
271  if (DriverArgs.hasFlag(options::OPT_fcuda_flush_denormals_to_zero,
272  options::OPT_fno_cuda_flush_denormals_to_zero, false))
273  CC1Args.push_back("-fcuda-flush-denormals-to-zero");
274 
275  if (DriverArgs.hasFlag(options::OPT_fcuda_approx_transcendentals,
276  options::OPT_fno_cuda_approx_transcendentals, false))
277  CC1Args.push_back("-fcuda-approx-transcendentals");
278 
279  if (DriverArgs.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc,
280  false))
281  CC1Args.push_back("-fgpu-rdc");
282 
283  // Default to "hidden" visibility, as object level linking will not be
284  // supported for the foreseeable future.
285  if (!DriverArgs.hasArg(options::OPT_fvisibility_EQ,
286  options::OPT_fvisibility_ms_compat)) {
287  CC1Args.append({"-fvisibility", "hidden"});
288  CC1Args.push_back("-fapply-global-visibility-to-externs");
289  }
290  ArgStringList LibraryPaths;
291 
292  // Find in --hip-device-lib-path and HIP_LIBRARY_PATH.
293  for (auto Path :
294  DriverArgs.getAllArgValues(options::OPT_hip_device_lib_path_EQ))
295  LibraryPaths.push_back(DriverArgs.MakeArgString(Path));
296 
297  addDirectoryList(DriverArgs, LibraryPaths, "-L", "HIP_DEVICE_LIB_PATH");
298 
300 
301  // Add bitcode library in --hip-device-lib.
302  for (auto Lib : DriverArgs.getAllArgValues(options::OPT_hip_device_lib_EQ)) {
303  BCLibs.push_back(DriverArgs.MakeArgString(Lib));
304  }
305 
306  // If --hip-device-lib is not set, add the default bitcode libraries.
307  if (BCLibs.empty()) {
308  // Get the bc lib file name for ISA version. For example,
309  // gfx803 => oclc_isa_version_803.amdgcn.bc.
310  std::string GFXVersion = GpuArch.drop_front(3).str();
311  std::string ISAVerBC = "oclc_isa_version_" + GFXVersion + ".amdgcn.bc";
312 
313  llvm::StringRef FlushDenormalControlBC;
314  if (DriverArgs.hasArg(options::OPT_fcuda_flush_denormals_to_zero))
315  FlushDenormalControlBC = "oclc_daz_opt_on.amdgcn.bc";
316  else
317  FlushDenormalControlBC = "oclc_daz_opt_off.amdgcn.bc";
318 
319  BCLibs.append({"hip.amdgcn.bc", "opencl.amdgcn.bc", "ocml.amdgcn.bc",
320  "ockl.amdgcn.bc", "oclc_finite_only_off.amdgcn.bc",
321  FlushDenormalControlBC,
322  "oclc_correctly_rounded_sqrt_on.amdgcn.bc",
323  "oclc_unsafe_math_off.amdgcn.bc", ISAVerBC});
324  }
325  for (auto Lib : BCLibs)
326  addBCLib(getDriver(), DriverArgs, CC1Args, LibraryPaths, Lib);
327 
328 }
329 
330 llvm::opt::DerivedArgList *
331 HIPToolChain::TranslateArgs(const llvm::opt::DerivedArgList &Args,
332  StringRef BoundArch,
333  Action::OffloadKind DeviceOffloadKind) const {
334  DerivedArgList *DAL =
335  HostTC.TranslateArgs(Args, BoundArch, DeviceOffloadKind);
336  if (!DAL)
337  DAL = new DerivedArgList(Args.getBaseArgs());
338 
339  const OptTable &Opts = getDriver().getOpts();
340 
341  for (Arg *A : Args) {
342  if (A->getOption().matches(options::OPT_Xarch__)) {
343  // Skip this argument unless the architecture matches BoundArch.
344  if (BoundArch.empty() || A->getValue(0) != BoundArch)
345  continue;
346 
347  unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(1));
348  unsigned Prev = Index;
349  std::unique_ptr<Arg> XarchArg(Opts.ParseOneArg(Args, Index));
350 
351  // If the argument parsing failed or more than one argument was
352  // consumed, the -Xarch_ argument's parameter tried to consume
353  // extra arguments. Emit an error and ignore.
354  //
355  // We also want to disallow any options which would alter the
356  // driver behavior; that isn't going to work in our model. We
357  // use isDriverOption() as an approximation, although things
358  // like -O4 are going to slip through.
359  if (!XarchArg || Index > Prev + 1) {
360  getDriver().Diag(diag::err_drv_invalid_Xarch_argument_with_args)
361  << A->getAsString(Args);
362  continue;
363  } else if (XarchArg->getOption().hasFlag(options::DriverOption)) {
364  getDriver().Diag(diag::err_drv_invalid_Xarch_argument_isdriver)
365  << A->getAsString(Args);
366  continue;
367  }
368  XarchArg->setBaseArg(A);
369  A = XarchArg.release();
370  DAL->AddSynthesizedArg(A);
371  }
372  DAL->append(A);
373  }
374 
375  if (!BoundArch.empty()) {
376  DAL->eraseArg(options::OPT_march_EQ);
377  DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), BoundArch);
378  }
379 
380  return DAL;
381 }
382 
384  assert(getTriple().getArch() == llvm::Triple::amdgcn);
385  return new tools::AMDGCN::Linker(*this);
386 }
387 
388 void HIPToolChain::addClangWarningOptions(ArgStringList &CC1Args) const {
390 }
391 
393 HIPToolChain::GetCXXStdlibType(const ArgList &Args) const {
394  return HostTC.GetCXXStdlibType(Args);
395 }
396 
397 void HIPToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
398  ArgStringList &CC1Args) const {
399  HostTC.AddClangSystemIncludeArgs(DriverArgs, CC1Args);
400 }
401 
403  ArgStringList &CC1Args) const {
404  HostTC.AddClangCXXStdlibIncludeArgs(Args, CC1Args);
405 }
406 
407 void HIPToolChain::AddIAMCUIncludeArgs(const ArgList &Args,
408  ArgStringList &CC1Args) const {
409  HostTC.AddIAMCUIncludeArgs(Args, CC1Args);
410 }
411 
413  // The HIPToolChain only supports sanitizers in the sense that it allows
414  // sanitizer arguments on the command line if they are supported by the host
415  // toolchain. The HIPToolChain will actually ignore any command line
416  // arguments for any of these "supported" sanitizers. That means that no
417  // sanitization of device code is actually supported at this time.
418  //
419  // This behavior is necessary because the host and device toolchains
420  // invocations often share the command line, so the device toolchain must
421  // tolerate flags meant only for the host toolchain.
423 }
424 
426  const ArgList &Args) const {
427  return HostTC.computeMSVCVersion(D, Args);
428 }
virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const
Add warning options that need to be passed to cc1 for this target.
Definition: ToolChain.cpp:672
void handleTargetFeaturesGroup(const llvm::opt::ArgList &Args, std::vector< StringRef > &Features, llvm::opt::OptSpecifier Group)
std::string GetTemporaryPath(StringRef Prefix, StringRef Suffix) const
GetTemporaryPath - Return the pathname of a temporary file to use as part of compilation; the file wi...
Definition: Driver.cpp:4492
void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add the clang cc1 arguments for system include paths.
Definition: HIP.cpp:397
virtual void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set the include paths to use for...
Definition: ToolChain.cpp:785
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:108
#define NULL_FILE
Definition: HIP.cpp:29
const char * getFilename() const
Definition: InputInfo.h:83
path_list & getProgramPaths()
Definition: ToolChain.h:234
virtual void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Add the clang cc1 arguments for system include paths.
Definition: ToolChain.cpp:663
std::string Dir
The path the driver executable was in, as invoked from the command line.
Definition: Driver.h:119
SanitizerMask getSupportedSanitizers() const override
Return sanitizers which are available in this toolchain.
Definition: HIP.cpp:412
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
types::ID getType() const
Definition: Action.h:140
void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add arguments to use MCU GCC toolchain includes.
Definition: HIP.cpp:407
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:57
void addDirectoryList(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const char *ArgName, const char *EnvVar)
return Out str()
void constructHIPFatbinCommand(Compilation &C, const JobAction &JA, StringRef OutputFileName, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const Tool &T)
Definition: HIP.cpp:184
void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CC1Args) const override
AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set the include paths to use for...
Definition: HIP.cpp:402
void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const override
Add warning options that need to be passed to cc1 for this target.
Definition: HIP.cpp:388
void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const override
Add options that need to be passed to cc1 for this target.
Definition: HIP.cpp:255
virtual VersionTuple computeMSVCVersion(const Driver *D, const llvm::opt::ArgList &Args) const
On Windows, returns the MSVC compatibility version.
Definition: ToolChain.cpp:906
void addCommand(std::unique_ptr< Command > C)
Definition: Compilation.h:205
HIPToolChain(const Driver &D, const llvm::Triple &Triple, const ToolChain &HostTC, const llvm::opt::ArgList &Args)
Definition: HIP.cpp:247
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:209
const llvm::opt::DerivedArgList & getArgs() const
Definition: Compilation.h:186
llvm::opt::DerivedArgList * TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch, Action::OffloadKind DeviceOffloadKind) const override
TranslateArgs - Create a new derived argument list for any argument translations this ToolChain may w...
Definition: HIP.cpp:331
const Driver & getDriver() const
Definition: ToolChain.h:193
CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override
Definition: HIP.cpp:393
Dataflow Directional Tag Classes.
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
const Driver & getDriver() const
Definition: Compilation.h:133
const llvm::Triple & getTriple() const
Definition: ToolChain.h:195
virtual SanitizerMask getSupportedSanitizers() const
Return sanitizers which are available in this toolchain.
Definition: ToolChain.cpp:862
VersionTuple computeMSVCVersion(const Driver *D, const llvm::opt::ArgList &Args) const override
On Windows, returns the MSVC compatibility version.
Definition: HIP.cpp:425
virtual llvm::opt::DerivedArgList * TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch, Action::OffloadKind DeviceOffloadKind) const
TranslateArgs - Create a new derived argument list for any argument translations this ToolChain may w...
Definition: ToolChain.h:278
const llvm::opt::OptTable & getOpts() const
Definition: Driver.h:298
virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:727
Tool * buildLinker() const override
Definition: HIP.cpp:383
const char * addTempFile(const char *Name)
addTempFile - Add a file to remove on exit, and returns its argument.
Definition: Compilation.h:232
virtual void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Add arguments to use MCU GCC toolchain includes.
Definition: ToolChain.cpp:889
virtual void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const
Add options that need to be passed to cc1 for this target.
Definition: ToolChain.cpp:668
const char * getOffloadingArch() const
Definition: Action.h:197
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88