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