clang  10.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",
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{
174  "-flavor", "gnu", "-shared", "-o", Output.getFilename(), InputFileName};
175  SmallString<128> LldPath(C.getDriver().Dir);
176  llvm::sys::path::append(LldPath, "lld");
177  const char *Lld = Args.MakeArgString(LldPath);
178  C.addCommand(llvm::make_unique<Command>(JA, *this, Lld, LldArgs, Inputs));
179 }
180 
181 // Construct a clang-offload-bundler command to bundle code objects for
182 // different GPU's into a HIP fat binary.
184  StringRef OutputFileName, const InputInfoList &Inputs,
185  const llvm::opt::ArgList &Args, const Tool& T) {
186  // Construct clang-offload-bundler command to bundle object files for
187  // for different GPU archs.
188  ArgStringList BundlerArgs;
189  BundlerArgs.push_back(Args.MakeArgString("-type=o"));
190 
191  // ToDo: Remove the dummy host binary entry which is required by
192  // clang-offload-bundler.
193  std::string BundlerTargetArg = "-targets=host-x86_64-unknown-linux";
194  std::string BundlerInputArg = "-inputs=" NULL_FILE;
195 
196  for (const auto &II : Inputs) {
197  const auto* A = II.getAction();
198  BundlerTargetArg = BundlerTargetArg + ",hip-amdgcn-amd-amdhsa-" +
199  StringRef(A->getOffloadingArch()).str();
200  BundlerInputArg = BundlerInputArg + "," + II.getFilename();
201  }
202  BundlerArgs.push_back(Args.MakeArgString(BundlerTargetArg));
203  BundlerArgs.push_back(Args.MakeArgString(BundlerInputArg));
204 
205  auto BundlerOutputArg =
206  Args.MakeArgString(std::string("-outputs=").append(OutputFileName));
207  BundlerArgs.push_back(BundlerOutputArg);
208 
209  SmallString<128> BundlerPath(C.getDriver().Dir);
210  llvm::sys::path::append(BundlerPath, "clang-offload-bundler");
211  const char *Bundler = Args.MakeArgString(BundlerPath);
212  C.addCommand(llvm::make_unique<Command>(JA, T, Bundler, BundlerArgs, Inputs));
213 }
214 
215 // For amdgcn the inputs of the linker job are device bitcode and output is
216 // object file. It calls llvm-link, opt, llc, then lld steps.
217 void AMDGCN::Linker::ConstructJob(Compilation &C, const JobAction &JA,
218  const InputInfo &Output,
219  const InputInfoList &Inputs,
220  const ArgList &Args,
221  const char *LinkingOutput) const {
222 
223  if (JA.getType() == types::TY_HIP_FATBIN)
224  return constructHIPFatbinCommand(C, JA, Output.getFilename(), Inputs, Args, *this);
225 
226  assert(getToolChain().getTriple().getArch() == llvm::Triple::amdgcn &&
227  "Unsupported target");
228 
229  std::string SubArchName = JA.getOffloadingArch();
230  assert(StringRef(SubArchName).startswith("gfx") && "Unsupported sub arch");
231 
232  // Prefix for temporary file name.
233  std::string Prefix =
234  llvm::sys::path::stem(Inputs[0].getFilename()).str() + "-" + SubArchName;
235 
236  // Each command outputs different files.
237  const char *LLVMLinkCommand =
238  constructLLVMLinkCommand(C, JA, Inputs, Args, SubArchName, Prefix);
239  const char *OptCommand = constructOptCommand(C, JA, Inputs, Args, SubArchName,
240  Prefix, LLVMLinkCommand);
241  const char *LlcCommand =
242  constructLlcCommand(C, JA, Inputs, Args, SubArchName, Prefix, OptCommand);
243  constructLldCommand(C, JA, Inputs, Output, Args, LlcCommand);
244 }
245 
246 HIPToolChain::HIPToolChain(const Driver &D, const llvm::Triple &Triple,
247  const ToolChain &HostTC, const ArgList &Args)
248  : ToolChain(D, Triple, Args), HostTC(HostTC) {
249  // Lookup binaries into the driver directory, this is used to
250  // discover the clang-offload-bundler executable.
251  getProgramPaths().push_back(getDriver().Dir);
252 }
253 
255  const llvm::opt::ArgList &DriverArgs,
256  llvm::opt::ArgStringList &CC1Args,
257  Action::OffloadKind DeviceOffloadingKind) const {
258  HostTC.addClangTargetOptions(DriverArgs, CC1Args, DeviceOffloadingKind);
259 
260  StringRef GpuArch = DriverArgs.getLastArgValue(options::OPT_march_EQ);
261  assert(!GpuArch.empty() && "Must have an explicit GPU arch.");
262  (void) GpuArch;
263  assert(DeviceOffloadingKind == Action::OFK_HIP &&
264  "Only HIP offloading kinds are supported for GPUs.");
265 
266  CC1Args.push_back("-target-cpu");
267  CC1Args.push_back(DriverArgs.MakeArgStringRef(GpuArch));
268  CC1Args.push_back("-fcuda-is-device");
269 
270  if (DriverArgs.hasFlag(options::OPT_fcuda_flush_denormals_to_zero,
271  options::OPT_fno_cuda_flush_denormals_to_zero, false))
272  CC1Args.push_back("-fcuda-flush-denormals-to-zero");
273 
274  if (DriverArgs.hasFlag(options::OPT_fcuda_approx_transcendentals,
275  options::OPT_fno_cuda_approx_transcendentals, false))
276  CC1Args.push_back("-fcuda-approx-transcendentals");
277 
278  if (DriverArgs.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc,
279  false))
280  CC1Args.push_back("-fgpu-rdc");
281 
282  // Default to "hidden" visibility, as object level linking will not be
283  // supported for the foreseeable future.
284  if (!DriverArgs.hasArg(options::OPT_fvisibility_EQ,
285  options::OPT_fvisibility_ms_compat)) {
286  CC1Args.append({"-fvisibility", "hidden"});
287  CC1Args.push_back("-fapply-global-visibility-to-externs");
288  }
289  ArgStringList LibraryPaths;
290 
291  // Find in --hip-device-lib-path and HIP_LIBRARY_PATH.
292  for (auto Path :
293  DriverArgs.getAllArgValues(options::OPT_hip_device_lib_path_EQ))
294  LibraryPaths.push_back(DriverArgs.MakeArgString(Path));
295 
296  addDirectoryList(DriverArgs, LibraryPaths, "-L", "HIP_DEVICE_LIB_PATH");
297 
299 
300  // Add bitcode library in --hip-device-lib.
301  for (auto Lib : DriverArgs.getAllArgValues(options::OPT_hip_device_lib_EQ)) {
302  BCLibs.push_back(DriverArgs.MakeArgString(Lib));
303  }
304 
305  // If --hip-device-lib is not set, add the default bitcode libraries.
306  if (BCLibs.empty()) {
307  // Get the bc lib file name for ISA version. For example,
308  // gfx803 => oclc_isa_version_803.amdgcn.bc.
309  std::string GFXVersion = GpuArch.drop_front(3).str();
310  std::string ISAVerBC = "oclc_isa_version_" + GFXVersion + ".amdgcn.bc";
311 
312  llvm::StringRef FlushDenormalControlBC;
313  if (DriverArgs.hasArg(options::OPT_fcuda_flush_denormals_to_zero))
314  FlushDenormalControlBC = "oclc_daz_opt_on.amdgcn.bc";
315  else
316  FlushDenormalControlBC = "oclc_daz_opt_off.amdgcn.bc";
317 
318  llvm::StringRef WaveFrontSizeBC;
319  if (stoi(GFXVersion) < 1000)
320  WaveFrontSizeBC = "oclc_wavefrontsize64_on.amdgcn.bc";
321  else
322  WaveFrontSizeBC = "oclc_wavefrontsize64_off.amdgcn.bc";
323 
324  BCLibs.append({"hip.amdgcn.bc", "opencl.amdgcn.bc", "ocml.amdgcn.bc",
325  "ockl.amdgcn.bc", "oclc_finite_only_off.amdgcn.bc",
326  FlushDenormalControlBC,
327  "oclc_correctly_rounded_sqrt_on.amdgcn.bc",
328  "oclc_unsafe_math_off.amdgcn.bc", ISAVerBC,
329  WaveFrontSizeBC});
330  }
331  for (auto Lib : BCLibs)
332  addBCLib(getDriver(), DriverArgs, CC1Args, LibraryPaths, Lib);
333 }
334 
335 llvm::opt::DerivedArgList *
336 HIPToolChain::TranslateArgs(const llvm::opt::DerivedArgList &Args,
337  StringRef BoundArch,
338  Action::OffloadKind DeviceOffloadKind) const {
339  DerivedArgList *DAL =
340  HostTC.TranslateArgs(Args, BoundArch, DeviceOffloadKind);
341  if (!DAL)
342  DAL = new DerivedArgList(Args.getBaseArgs());
343 
344  const OptTable &Opts = getDriver().getOpts();
345 
346  for (Arg *A : Args) {
347  if (A->getOption().matches(options::OPT_Xarch__)) {
348  // Skip this argument unless the architecture matches BoundArch.
349  if (BoundArch.empty() || A->getValue(0) != BoundArch)
350  continue;
351 
352  unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(1));
353  unsigned Prev = Index;
354  std::unique_ptr<Arg> XarchArg(Opts.ParseOneArg(Args, Index));
355 
356  // If the argument parsing failed or more than one argument was
357  // consumed, the -Xarch_ argument's parameter tried to consume
358  // extra arguments. Emit an error and ignore.
359  //
360  // We also want to disallow any options which would alter the
361  // driver behavior; that isn't going to work in our model. We
362  // use isDriverOption() as an approximation, although things
363  // like -O4 are going to slip through.
364  if (!XarchArg || Index > Prev + 1) {
365  getDriver().Diag(diag::err_drv_invalid_Xarch_argument_with_args)
366  << A->getAsString(Args);
367  continue;
368  } else if (XarchArg->getOption().hasFlag(options::DriverOption)) {
369  getDriver().Diag(diag::err_drv_invalid_Xarch_argument_isdriver)
370  << A->getAsString(Args);
371  continue;
372  }
373  XarchArg->setBaseArg(A);
374  A = XarchArg.release();
375  DAL->AddSynthesizedArg(A);
376  }
377  DAL->append(A);
378  }
379 
380  if (!BoundArch.empty()) {
381  DAL->eraseArg(options::OPT_march_EQ);
382  DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), BoundArch);
383  }
384 
385  return DAL;
386 }
387 
389  assert(getTriple().getArch() == llvm::Triple::amdgcn);
390  return new tools::AMDGCN::Linker(*this);
391 }
392 
393 void HIPToolChain::addClangWarningOptions(ArgStringList &CC1Args) const {
395 }
396 
398 HIPToolChain::GetCXXStdlibType(const ArgList &Args) const {
399  return HostTC.GetCXXStdlibType(Args);
400 }
401 
402 void HIPToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
403  ArgStringList &CC1Args) const {
404  HostTC.AddClangSystemIncludeArgs(DriverArgs, CC1Args);
405 }
406 
408  ArgStringList &CC1Args) const {
409  HostTC.AddClangCXXStdlibIncludeArgs(Args, CC1Args);
410 }
411 
412 void HIPToolChain::AddIAMCUIncludeArgs(const ArgList &Args,
413  ArgStringList &CC1Args) const {
414  HostTC.AddIAMCUIncludeArgs(Args, CC1Args);
415 }
416 
418  // The HIPToolChain only supports sanitizers in the sense that it allows
419  // sanitizer arguments on the command line if they are supported by the host
420  // toolchain. The HIPToolChain will actually ignore any command line
421  // arguments for any of these "supported" sanitizers. That means that no
422  // sanitization of device code is actually supported at this time.
423  //
424  // This behavior is necessary because the host and device toolchains
425  // invocations often share the command line, so the device toolchain must
426  // tolerate flags meant only for the host toolchain.
428 }
429 
431  const ArgList &Args) const {
432  return HostTC.computeMSVCVersion(D, Args);
433 }
virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const
Add warning options that need to be passed to cc1 for this target.
Definition: ToolChain.cpp:708
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:4538
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:402
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:821
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:699
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:417
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:412
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)
void constructHIPFatbinCommand(Compilation &C, const JobAction &JA, StringRef OutputFileName, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const Tool &T)
Definition: HIP.cpp:183
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:407
void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const override
Add warning options that need to be passed to cc1 for this target.
Definition: HIP.cpp:393
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:254
virtual VersionTuple computeMSVCVersion(const Driver *D, const llvm::opt::ArgList &Args) const
On Windows, returns the MSVC compatibility version.
Definition: ToolChain.cpp:939
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:246
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:336
const Driver & getDriver() const
Definition: ToolChain.h:193
CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override
Definition: HIP.cpp:398
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:894
VersionTuple computeMSVCVersion(const Driver *D, const llvm::opt::ArgList &Args) const override
On Windows, returns the MSVC compatibility version.
Definition: HIP.cpp:430
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:295
virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:763
Tool * buildLinker() const override
Definition: HIP.cpp:388
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:922
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:704
const char * getOffloadingArch() const
Definition: Action.h:197
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88