clang  9.0.0svn
NetBSD.cpp
Go to the documentation of this file.
1 //===--- NetBSD.cpp - NetBSD 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 "NetBSD.h"
10 #include "Arch/ARM.h"
11 #include "Arch/Mips.h"
12 #include "Arch/Sparc.h"
13 #include "CommonArgs.h"
15 #include "clang/Driver/Driver.h"
16 #include "clang/Driver/Options.h"
18 #include "llvm/Option/ArgList.h"
19 
20 using namespace clang::driver;
21 using namespace clang::driver::tools;
22 using namespace clang::driver::toolchains;
23 using namespace clang;
24 using namespace llvm::opt;
25 
27  const InputInfo &Output,
28  const InputInfoList &Inputs,
29  const ArgList &Args,
30  const char *LinkingOutput) const {
31  claimNoWarnArgs(Args);
32  ArgStringList CmdArgs;
33 
34  // GNU as needs different flags for creating the correct output format
35  // on architectures with different ABIs or optional feature sets.
36  switch (getToolChain().getArch()) {
37  case llvm::Triple::x86:
38  CmdArgs.push_back("--32");
39  break;
40  case llvm::Triple::arm:
41  case llvm::Triple::armeb:
42  case llvm::Triple::thumb:
43  case llvm::Triple::thumbeb: {
44  StringRef MArch, MCPU;
45  arm::getARMArchCPUFromArgs(Args, MArch, MCPU, /*FromAs*/ true);
46  std::string Arch =
47  arm::getARMTargetCPU(MCPU, MArch, getToolChain().getTriple());
48  CmdArgs.push_back(Args.MakeArgString("-mcpu=" + Arch));
49  break;
50  }
51 
52  case llvm::Triple::mips:
53  case llvm::Triple::mipsel:
54  case llvm::Triple::mips64:
55  case llvm::Triple::mips64el: {
56  StringRef CPUName;
57  StringRef ABIName;
58  mips::getMipsCPUAndABI(Args, getToolChain().getTriple(), CPUName, ABIName);
59 
60  CmdArgs.push_back("-march");
61  CmdArgs.push_back(CPUName.data());
62 
63  CmdArgs.push_back("-mabi");
64  CmdArgs.push_back(mips::getGnuCompatibleMipsABIName(ABIName).data());
65 
66  if (getToolChain().getTriple().isLittleEndian())
67  CmdArgs.push_back("-EL");
68  else
69  CmdArgs.push_back("-EB");
70 
71  AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
72  break;
73  }
74 
75  case llvm::Triple::sparc:
76  case llvm::Triple::sparcel: {
77  CmdArgs.push_back("-32");
78  std::string CPU = getCPUName(Args, getToolChain().getTriple());
79  CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
80  AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
81  break;
82  }
83 
84  case llvm::Triple::sparcv9: {
85  CmdArgs.push_back("-64");
86  std::string CPU = getCPUName(Args, getToolChain().getTriple());
87  CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
88  AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
89  break;
90  }
91 
92  default:
93  break;
94  }
95 
96  Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
97 
98  CmdArgs.push_back("-o");
99  CmdArgs.push_back(Output.getFilename());
100 
101  for (const auto &II : Inputs)
102  CmdArgs.push_back(II.getFilename());
103 
104  const char *Exec = Args.MakeArgString((getToolChain().GetProgramPath("as")));
105  C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
106 }
107 
109  const InputInfo &Output,
110  const InputInfoList &Inputs,
111  const ArgList &Args,
112  const char *LinkingOutput) const {
114  static_cast<const toolchains::NetBSD &>(getToolChain());
115  const Driver &D = ToolChain.getDriver();
116  ArgStringList CmdArgs;
117 
118  if (!D.SysRoot.empty())
119  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
120 
121  CmdArgs.push_back("--eh-frame-hdr");
122  if (Args.hasArg(options::OPT_static)) {
123  CmdArgs.push_back("-Bstatic");
124  if (Args.hasArg(options::OPT_pie)) {
125  Args.AddAllArgs(CmdArgs, options::OPT_pie);
126  CmdArgs.push_back("--no-dynamic-linker");
127  }
128  } else {
129  if (Args.hasArg(options::OPT_rdynamic))
130  CmdArgs.push_back("-export-dynamic");
131  if (Args.hasArg(options::OPT_shared)) {
132  CmdArgs.push_back("-Bshareable");
133  } else {
134  Args.AddAllArgs(CmdArgs, options::OPT_pie);
135  CmdArgs.push_back("-dynamic-linker");
136  CmdArgs.push_back("/libexec/ld.elf_so");
137  }
138  }
139 
140  // Many NetBSD architectures support more than one ABI.
141  // Determine the correct emulation for ld.
142  switch (ToolChain.getArch()) {
143  case llvm::Triple::x86:
144  CmdArgs.push_back("-m");
145  CmdArgs.push_back("elf_i386");
146  break;
147  case llvm::Triple::arm:
148  case llvm::Triple::thumb:
149  CmdArgs.push_back("-m");
150  switch (ToolChain.getTriple().getEnvironment()) {
151  case llvm::Triple::EABI:
152  case llvm::Triple::GNUEABI:
153  CmdArgs.push_back("armelf_nbsd_eabi");
154  break;
155  case llvm::Triple::EABIHF:
156  case llvm::Triple::GNUEABIHF:
157  CmdArgs.push_back("armelf_nbsd_eabihf");
158  break;
159  default:
160  CmdArgs.push_back("armelf_nbsd");
161  break;
162  }
163  break;
164  case llvm::Triple::armeb:
165  case llvm::Triple::thumbeb:
166  arm::appendBE8LinkFlag(Args, CmdArgs, ToolChain.getEffectiveTriple());
167  CmdArgs.push_back("-m");
168  switch (ToolChain.getTriple().getEnvironment()) {
169  case llvm::Triple::EABI:
170  case llvm::Triple::GNUEABI:
171  CmdArgs.push_back("armelfb_nbsd_eabi");
172  break;
173  case llvm::Triple::EABIHF:
174  case llvm::Triple::GNUEABIHF:
175  CmdArgs.push_back("armelfb_nbsd_eabihf");
176  break;
177  default:
178  CmdArgs.push_back("armelfb_nbsd");
179  break;
180  }
181  break;
182  case llvm::Triple::mips64:
183  case llvm::Triple::mips64el:
184  if (mips::hasMipsAbiArg(Args, "32")) {
185  CmdArgs.push_back("-m");
186  if (ToolChain.getArch() == llvm::Triple::mips64)
187  CmdArgs.push_back("elf32btsmip");
188  else
189  CmdArgs.push_back("elf32ltsmip");
190  } else if (mips::hasMipsAbiArg(Args, "64")) {
191  CmdArgs.push_back("-m");
192  if (ToolChain.getArch() == llvm::Triple::mips64)
193  CmdArgs.push_back("elf64btsmip");
194  else
195  CmdArgs.push_back("elf64ltsmip");
196  }
197  break;
198  case llvm::Triple::ppc:
199  CmdArgs.push_back("-m");
200  CmdArgs.push_back("elf32ppc_nbsd");
201  break;
202 
203  case llvm::Triple::ppc64:
204  case llvm::Triple::ppc64le:
205  CmdArgs.push_back("-m");
206  CmdArgs.push_back("elf64ppc");
207  break;
208 
209  case llvm::Triple::sparc:
210  CmdArgs.push_back("-m");
211  CmdArgs.push_back("elf32_sparc");
212  break;
213 
214  case llvm::Triple::sparcv9:
215  CmdArgs.push_back("-m");
216  CmdArgs.push_back("elf64_sparc");
217  break;
218 
219  default:
220  break;
221  }
222 
223  if (Output.isFilename()) {
224  CmdArgs.push_back("-o");
225  CmdArgs.push_back(Output.getFilename());
226  } else {
227  assert(Output.isNothing() && "Invalid output.");
228  }
229 
230  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
231  if (!Args.hasArg(options::OPT_shared)) {
232  CmdArgs.push_back(
233  Args.MakeArgString(ToolChain.GetFilePath("crt0.o")));
234  }
235  CmdArgs.push_back(
236  Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
237  if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) {
238  CmdArgs.push_back(
239  Args.MakeArgString(ToolChain.GetFilePath("crtbeginS.o")));
240  } else {
241  CmdArgs.push_back(
242  Args.MakeArgString(ToolChain.GetFilePath("crtbegin.o")));
243  }
244  }
245 
246  Args.AddAllArgs(CmdArgs, options::OPT_L);
247  Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
248  Args.AddAllArgs(CmdArgs, options::OPT_e);
249  Args.AddAllArgs(CmdArgs, options::OPT_s);
250  Args.AddAllArgs(CmdArgs, options::OPT_t);
251  Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
252  Args.AddAllArgs(CmdArgs, options::OPT_r);
253 
254  bool NeedsSanitizerDeps = addSanitizerRuntimes(getToolChain(), Args, CmdArgs);
255  bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
256  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
257 
258  const SanitizerArgs &SanArgs = ToolChain.getSanitizerArgs();
259  if (SanArgs.needsSharedRt()) {
260  CmdArgs.push_back("-rpath");
261  CmdArgs.push_back(Args.MakeArgString(
262  ToolChain.getCompilerRTPath().c_str()));
263  }
264 
265  unsigned Major, Minor, Micro;
266  ToolChain.getTriple().getOSVersion(Major, Minor, Micro);
267  bool useLibgcc = true;
268  if (Major >= 7 || Major == 0) {
269  switch (ToolChain.getArch()) {
270  case llvm::Triple::aarch64:
271  case llvm::Triple::aarch64_be:
272  case llvm::Triple::arm:
273  case llvm::Triple::armeb:
274  case llvm::Triple::thumb:
275  case llvm::Triple::thumbeb:
276  case llvm::Triple::ppc:
277  case llvm::Triple::ppc64:
278  case llvm::Triple::ppc64le:
279  case llvm::Triple::sparc:
280  case llvm::Triple::sparcv9:
281  case llvm::Triple::x86:
282  case llvm::Triple::x86_64:
283  useLibgcc = false;
284  break;
285  default:
286  break;
287  }
288  }
289 
290  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
291  addOpenMPRuntime(CmdArgs, getToolChain(), Args);
292  if (D.CCCIsCXX()) {
293  if (ToolChain.ShouldLinkCXXStdlib(Args))
294  ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
295  CmdArgs.push_back("-lm");
296  }
297  if (NeedsSanitizerDeps)
298  linkSanitizerRuntimeDeps(getToolChain(), CmdArgs);
299  if (NeedsXRayDeps)
300  linkXRayRuntimeDeps(ToolChain, CmdArgs);
301  if (Args.hasArg(options::OPT_pthread))
302  CmdArgs.push_back("-lpthread");
303  CmdArgs.push_back("-lc");
304 
305  if (useLibgcc) {
306  if (Args.hasArg(options::OPT_static)) {
307  // libgcc_eh depends on libc, so resolve as much as possible,
308  // pull in any new requirements from libc and then get the rest
309  // of libgcc.
310  CmdArgs.push_back("-lgcc_eh");
311  CmdArgs.push_back("-lc");
312  CmdArgs.push_back("-lgcc");
313  } else {
314  CmdArgs.push_back("-lgcc");
315  CmdArgs.push_back("--as-needed");
316  CmdArgs.push_back("-lgcc_s");
317  CmdArgs.push_back("--no-as-needed");
318  }
319  }
320  }
321 
322  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
323  if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie))
324  CmdArgs.push_back(
325  Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
326  else
327  CmdArgs.push_back(
328  Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
329  CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
330  }
331 
332  ToolChain.addProfileRTLibs(Args, CmdArgs);
333 
334  const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
335  C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
336 }
337 
338 /// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly.
339 
340 NetBSD::NetBSD(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
341  : Generic_ELF(D, Triple, Args) {
342  if (!Args.hasArg(options::OPT_nostdlib)) {
343  // When targeting a 32-bit platform, try the special directory used on
344  // 64-bit hosts, and only fall back to the main library directory if that
345  // doesn't work.
346  // FIXME: It'd be nicer to test if this directory exists, but I'm not sure
347  // what all logic is needed to emulate the '=' prefix here.
348  switch (Triple.getArch()) {
349  case llvm::Triple::x86:
350  getFilePaths().push_back("=/usr/lib/i386");
351  break;
352  case llvm::Triple::arm:
353  case llvm::Triple::armeb:
354  case llvm::Triple::thumb:
355  case llvm::Triple::thumbeb:
356  switch (Triple.getEnvironment()) {
357  case llvm::Triple::EABI:
358  case llvm::Triple::GNUEABI:
359  getFilePaths().push_back("=/usr/lib/eabi");
360  break;
361  case llvm::Triple::EABIHF:
362  case llvm::Triple::GNUEABIHF:
363  getFilePaths().push_back("=/usr/lib/eabihf");
364  break;
365  default:
366  getFilePaths().push_back("=/usr/lib/oabi");
367  break;
368  }
369  break;
370  case llvm::Triple::mips64:
371  case llvm::Triple::mips64el:
372  if (tools::mips::hasMipsAbiArg(Args, "o32"))
373  getFilePaths().push_back("=/usr/lib/o32");
374  else if (tools::mips::hasMipsAbiArg(Args, "64"))
375  getFilePaths().push_back("=/usr/lib/64");
376  break;
377  case llvm::Triple::ppc:
378  getFilePaths().push_back("=/usr/lib/powerpc");
379  break;
380  case llvm::Triple::sparc:
381  getFilePaths().push_back("=/usr/lib/sparc");
382  break;
383  default:
384  break;
385  }
386 
387  getFilePaths().push_back("=/usr/lib");
388  }
389 }
390 
392  return new tools::netbsd::Assembler(*this);
393 }
394 
395 Tool *NetBSD::buildLinker() const { return new tools::netbsd::Linker(*this); }
396 
398  unsigned Major, Minor, Micro;
399  getTriple().getOSVersion(Major, Minor, Micro);
400  if (Major >= 7 || Major == 0) {
401  switch (getArch()) {
402  case llvm::Triple::aarch64:
403  case llvm::Triple::aarch64_be:
404  case llvm::Triple::arm:
405  case llvm::Triple::armeb:
406  case llvm::Triple::thumb:
407  case llvm::Triple::thumbeb:
408  case llvm::Triple::ppc:
409  case llvm::Triple::ppc64:
410  case llvm::Triple::ppc64le:
411  case llvm::Triple::sparc:
412  case llvm::Triple::sparcv9:
413  case llvm::Triple::x86:
414  case llvm::Triple::x86_64:
415  return ToolChain::CST_Libcxx;
416  default:
417  break;
418  }
419  }
421 }
422 
423 void NetBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
424  llvm::opt::ArgStringList &CC1Args) const {
425  addSystemInclude(DriverArgs, CC1Args,
426  getDriver().SysRoot + "/usr/include/c++/");
427 }
428 
429 void NetBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
430  llvm::opt::ArgStringList &CC1Args) const {
431  addLibStdCXXIncludePaths(getDriver().SysRoot, "/usr/include/g++", "", "", "",
432  "", DriverArgs, CC1Args);
433 }
434 
435 llvm::ExceptionHandling NetBSD::GetExceptionModel(const ArgList &Args) const {
436  // NetBSD uses Dwarf exceptions on ARM.
437  llvm::Triple::ArchType TArch = getTriple().getArch();
438  if (TArch == llvm::Triple::arm || TArch == llvm::Triple::armeb ||
439  TArch == llvm::Triple::thumb || TArch == llvm::Triple::thumbeb)
440  return llvm::ExceptionHandling::DwarfCFI;
442 }
443 
445  const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
446  const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
448  if (IsX86 || IsX86_64) {
449  Res |= SanitizerKind::Address;
450  Res |= SanitizerKind::Function;
451  Res |= SanitizerKind::Leak;
452  Res |= SanitizerKind::SafeStack;
453  Res |= SanitizerKind::Scudo;
454  Res |= SanitizerKind::Vptr;
455  }
456  if (IsX86_64) {
457  Res |= SanitizerKind::DataFlow;
458  Res |= SanitizerKind::Efficiency;
459  Res |= SanitizerKind::Fuzzer;
460  Res |= SanitizerKind::FuzzerNoLink;
461  Res |= SanitizerKind::HWAddress;
462  Res |= SanitizerKind::KernelAddress;
463  Res |= SanitizerKind::KernelHWAddress;
464  Res |= SanitizerKind::KernelMemory;
465  Res |= SanitizerKind::Memory;
466  Res |= SanitizerKind::Thread;
467  }
468  return Res;
469 }
470 
471 void NetBSD::addClangTargetOptions(const ArgList &,
472  ArgStringList &CC1Args,
473  Action::OffloadKind) const {
474  const SanitizerArgs &SanArgs = getSanitizerArgs();
475  if (SanArgs.hasAnySanitizer())
476  CC1Args.push_back("-D_REENTRANT");
477 }
bool addXRayRuntime(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
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: NetBSD.cpp:471
const char * getSparcAsmModeForCPU(llvm::StringRef Name, const llvm::Triple &Triple)
void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: NetBSD.cpp:423
virtual void addProfileRTLibs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass a suitable profile runtime ...
Definition: ToolChain.cpp:656
std::string GetLinkerPath() const
Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name...
Definition: ToolChain.cpp:438
std::string getCPUName(const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
const char * getFilename() const
Definition: InputInfo.h:83
void linkSanitizerRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
Tool * buildAssembler() const override
Definition: NetBSD.cpp:391
void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override
ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs...
Definition: NetBSD.cpp:26
bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
std::string GetFilePath(const char *Name) const
Definition: ToolChain.cpp:430
path_list & getFilePaths()
Definition: ToolChain.h:223
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:57
bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value)
CXXStdlibType GetDefaultCXXStdlibType() const override
Definition: NetBSD.cpp:397
bool addOpenMPRuntime(llvm::opt::ArgStringList &CmdArgs, const ToolChain &TC, const llvm::opt::ArgList &Args, bool IsOffloadingHost=false, bool GompNeedsRT=false)
Returns true, if an OpenMP runtime has been added.
Tool * buildLinker() const override
Definition: NetBSD.cpp:395
void linkXRayRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
SanitizerMask getSupportedSanitizers() const override
Return sanitizers which are available in this toolchain.
Definition: NetBSD.cpp:444
void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override
ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs...
Definition: NetBSD.cpp:108
const llvm::Triple & getEffectiveTriple() const
Get the toolchain&#39;s effective clang triple.
Definition: ToolChain.h:215
void addCommand(std::unique_ptr< Command > C)
Definition: Compilation.h:205
void AddAssemblerKPIC(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:201
const Driver & getDriver() const
Definition: ToolChain.h:185
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition: Driver.h:172
void addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: NetBSD.cpp:429
static void addSystemInclude(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Utility function to add a system include directory to CC1 arguments.
Definition: ToolChain.cpp:701
constexpr XRayInstrMask None
Definition: XRayInstr.h:37
llvm::ExceptionHandling GetExceptionModel(const llvm::opt::ArgList &Args) const override
GetExceptionModel - Return the tool chain exception model.
Definition: NetBSD.cpp:435
std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch, const llvm::Triple &Triple)
bool ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const
Returns if the C++ standard library should be linked in.
Definition: ToolChain.cpp:754
Dataflow Directional Tag Classes.
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
std::string SysRoot
sysroot, if present
Definition: Driver.h:147
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
const SanitizerArgs & getSanitizerArgs() const
Definition: ToolChain.cpp:115
void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args, llvm::StringRef &Arch, llvm::StringRef &CPU, bool FromAs=false)
void claimNoWarnArgs(const llvm::opt::ArgList &Args)
uint64_t SanitizerMask
Definition: Sanitizers.h:25
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
const llvm::Triple & getTriple() const
Definition: ToolChain.h:187
virtual SanitizerMask getSupportedSanitizers() const
Return sanitizers which are available in this toolchain.
Definition: ToolChain.cpp:817
void appendBE8LinkFlag(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const llvm::Triple &Triple)
virtual std::string getCompilerRTPath() const
Definition: ToolChain.cpp:354
StringRef getGnuCompatibleMipsABIName(StringRef ABI)
Definition: Mips.cpp:143
bool isNothing() const
Definition: InputInfo.h:74
bool isFilename() const
Definition: InputInfo.h:75
bool addLibStdCXXIncludePaths(Twine Base, Twine Suffix, StringRef GCCTriple, StringRef GCCMultiarchTriple, StringRef TargetMultiarchTriple, Twine IncludeSuffix, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Helper to add the variant paths of a libstdc++ installation.
Definition: Gnu.cpp:2556
void getMipsCPUAndABI(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, StringRef &CPUName, StringRef &ABIName)
virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddCXXStdlibLibArgs - Add the system specific linker arguments to use for the given C++ standard libr...
Definition: ToolChain.cpp:760
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88