clang  14.0.0git
ToolChain.cpp
Go to the documentation of this file.
1 //===- ToolChain.cpp - Collections of tools for one platform --------------===//
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 
10 #include "ToolChains/Arch/ARM.h"
11 #include "ToolChains/Clang.h"
12 #include "ToolChains/Flang.h"
15 #include "clang/Basic/Sanitizers.h"
16 #include "clang/Config/config.h"
17 #include "clang/Driver/Action.h"
18 #include "clang/Driver/Driver.h"
20 #include "clang/Driver/InputInfo.h"
21 #include "clang/Driver/Job.h"
22 #include "clang/Driver/Options.h"
24 #include "clang/Driver/XRayArgs.h"
25 #include "llvm/ADT/STLExtras.h"
26 #include "llvm/ADT/SmallString.h"
27 #include "llvm/ADT/StringRef.h"
28 #include "llvm/ADT/Triple.h"
29 #include "llvm/ADT/Twine.h"
30 #include "llvm/Config/llvm-config.h"
31 #include "llvm/MC/MCTargetOptions.h"
32 #include "llvm/MC/TargetRegistry.h"
33 #include "llvm/Option/Arg.h"
34 #include "llvm/Option/ArgList.h"
35 #include "llvm/Option/OptTable.h"
36 #include "llvm/Option/Option.h"
37 #include "llvm/Support/ErrorHandling.h"
38 #include "llvm/Support/FileSystem.h"
39 #include "llvm/Support/Path.h"
40 #include "llvm/Support/TargetParser.h"
41 #include "llvm/Support/VersionTuple.h"
42 #include "llvm/Support/VirtualFileSystem.h"
43 #include <cassert>
44 #include <cstddef>
45 #include <cstring>
46 #include <string>
47 
48 using namespace clang;
49 using namespace driver;
50 using namespace tools;
51 using namespace llvm;
52 using namespace llvm::opt;
53 
54 static llvm::opt::Arg *GetRTTIArgument(const ArgList &Args) {
55  return Args.getLastArg(options::OPT_mkernel, options::OPT_fapple_kext,
56  options::OPT_fno_rtti, options::OPT_frtti);
57 }
58 
59 static ToolChain::RTTIMode CalculateRTTIMode(const ArgList &Args,
60  const llvm::Triple &Triple,
61  const Arg *CachedRTTIArg) {
62  // Explicit rtti/no-rtti args
63  if (CachedRTTIArg) {
64  if (CachedRTTIArg->getOption().matches(options::OPT_frtti))
65  return ToolChain::RM_Enabled;
66  else
68  }
69 
70  // -frtti is default, except for the PS4 CPU.
71  return (Triple.isPS4CPU()) ? ToolChain::RM_Disabled : ToolChain::RM_Enabled;
72 }
73 
74 ToolChain::ToolChain(const Driver &D, const llvm::Triple &T,
75  const ArgList &Args)
76  : D(D), Triple(T), Args(Args), CachedRTTIArg(GetRTTIArgument(Args)),
77  CachedRTTIMode(CalculateRTTIMode(Args, Triple, CachedRTTIArg)) {
78  std::string RuntimePath = getRuntimePath();
79  if (getVFS().exists(RuntimePath))
80  getLibraryPaths().push_back(RuntimePath);
81 
82  std::string StdlibPath = getStdlibPath();
83  if (getVFS().exists(StdlibPath))
84  getFilePaths().push_back(StdlibPath);
85 
86  std::string CandidateLibPath = getArchSpecificLibPath();
87  if (getVFS().exists(CandidateLibPath))
88  getFilePaths().push_back(CandidateLibPath);
89 }
90 
91 void ToolChain::setTripleEnvironment(llvm::Triple::EnvironmentType Env) {
92  Triple.setEnvironment(Env);
93  if (EffectiveTriple != llvm::Triple())
94  EffectiveTriple.setEnvironment(Env);
95 }
96 
97 ToolChain::~ToolChain() = default;
98 
99 llvm::vfs::FileSystem &ToolChain::getVFS() const {
100  return getDriver().getVFS();
101 }
102 
104  return Args.hasFlag(options::OPT_fintegrated_as,
105  options::OPT_fno_integrated_as,
107 }
108 
110  return ENABLE_X86_RELAX_RELOCATIONS;
111 }
112 
114  return false;
115 }
116 
118  if (!SanitizerArguments.get())
119  SanitizerArguments.reset(new SanitizerArgs(*this, Args));
120  return *SanitizerArguments.get();
121 }
122 
124  if (!XRayArguments.get())
125  XRayArguments.reset(new XRayArgs(*this, Args));
126  return *XRayArguments.get();
127 }
128 
129 namespace {
130 
131 struct DriverSuffix {
132  const char *Suffix;
133  const char *ModeFlag;
134 };
135 
136 } // namespace
137 
138 static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) {
139  // A list of known driver suffixes. Suffixes are compared against the
140  // program name in order. If there is a match, the frontend type is updated as
141  // necessary by applying the ModeFlag.
142  static const DriverSuffix DriverSuffixes[] = {
143  {"clang", nullptr},
144  {"clang++", "--driver-mode=g++"},
145  {"clang-c++", "--driver-mode=g++"},
146  {"clang-cc", nullptr},
147  {"clang-cpp", "--driver-mode=cpp"},
148  {"clang-g++", "--driver-mode=g++"},
149  {"clang-gcc", nullptr},
150  {"clang-cl", "--driver-mode=cl"},
151  {"cc", nullptr},
152  {"cpp", "--driver-mode=cpp"},
153  {"cl", "--driver-mode=cl"},
154  {"++", "--driver-mode=g++"},
155  {"flang", "--driver-mode=flang"},
156  };
157 
158  for (size_t i = 0; i < llvm::array_lengthof(DriverSuffixes); ++i) {
159  StringRef Suffix(DriverSuffixes[i].Suffix);
160  if (ProgName.endswith(Suffix)) {
161  Pos = ProgName.size() - Suffix.size();
162  return &DriverSuffixes[i];
163  }
164  }
165  return nullptr;
166 }
167 
168 /// Normalize the program name from argv[0] by stripping the file extension if
169 /// present and lower-casing the string on Windows.
170 static std::string normalizeProgramName(llvm::StringRef Argv0) {
171  std::string ProgName = std::string(llvm::sys::path::stem(Argv0));
172 #ifdef _WIN32
173  // Transform to lowercase for case insensitive file systems.
174  std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(), ::tolower);
175 #endif
176  return ProgName;
177 }
178 
179 static const DriverSuffix *parseDriverSuffix(StringRef ProgName, size_t &Pos) {
180  // Try to infer frontend type and default target from the program name by
181  // comparing it against DriverSuffixes in order.
182 
183  // If there is a match, the function tries to identify a target as prefix.
184  // E.g. "x86_64-linux-clang" as interpreted as suffix "clang" with target
185  // prefix "x86_64-linux". If such a target prefix is found, it may be
186  // added via -target as implicit first argument.
187  const DriverSuffix *DS = FindDriverSuffix(ProgName, Pos);
188 
189  if (!DS) {
190  // Try again after stripping any trailing version number:
191  // clang++3.5 -> clang++
192  ProgName = ProgName.rtrim("0123456789.");
193  DS = FindDriverSuffix(ProgName, Pos);
194  }
195 
196  if (!DS) {
197  // Try again after stripping trailing -component.
198  // clang++-tot -> clang++
199  ProgName = ProgName.slice(0, ProgName.rfind('-'));
200  DS = FindDriverSuffix(ProgName, Pos);
201  }
202  return DS;
203 }
204 
207  std::string ProgName = normalizeProgramName(PN);
208  size_t SuffixPos;
209  const DriverSuffix *DS = parseDriverSuffix(ProgName, SuffixPos);
210  if (!DS)
211  return {};
212  size_t SuffixEnd = SuffixPos + strlen(DS->Suffix);
213 
214  size_t LastComponent = ProgName.rfind('-', SuffixPos);
215  if (LastComponent == std::string::npos)
216  return ParsedClangName(ProgName.substr(0, SuffixEnd), DS->ModeFlag);
217  std::string ModeSuffix = ProgName.substr(LastComponent + 1,
218  SuffixEnd - LastComponent - 1);
219 
220  // Infer target from the prefix.
221  StringRef Prefix(ProgName);
222  Prefix = Prefix.slice(0, LastComponent);
223  std::string IgnoredError;
224  bool IsRegistered =
225  llvm::TargetRegistry::lookupTarget(std::string(Prefix), IgnoredError);
226  return ParsedClangName{std::string(Prefix), ModeSuffix, DS->ModeFlag,
227  IsRegistered};
228 }
229 
231  // In universal driver terms, the arch name accepted by -arch isn't exactly
232  // the same as the ones that appear in the triple. Roughly speaking, this is
233  // an inverse of the darwin::getArchTypeForDarwinArchName() function.
234  switch (Triple.getArch()) {
235  case llvm::Triple::aarch64: {
236  if (getTriple().isArm64e())
237  return "arm64e";
238  return "arm64";
239  }
240  case llvm::Triple::aarch64_32:
241  return "arm64_32";
242  case llvm::Triple::ppc:
243  return "ppc";
244  case llvm::Triple::ppcle:
245  return "ppcle";
246  case llvm::Triple::ppc64:
247  return "ppc64";
248  case llvm::Triple::ppc64le:
249  return "ppc64le";
250  default:
251  return Triple.getArchName();
252  }
253 }
254 
256  return Input.getFilename();
257 }
258 
259 bool ToolChain::IsUnwindTablesDefault(const ArgList &Args) const {
260  return false;
261 }
262 
263 Tool *ToolChain::getClang() const {
264  if (!Clang)
265  Clang.reset(new tools::Clang(*this));
266  return Clang.get();
267 }
268 
269 Tool *ToolChain::getFlang() const {
270  if (!Flang)
271  Flang.reset(new tools::Flang(*this));
272  return Flang.get();
273 }
274 
276  return new tools::ClangAs(*this);
277 }
278 
280  llvm_unreachable("Linking is not supported by this toolchain");
281 }
282 
284  llvm_unreachable("Creating static lib is not supported by this toolchain");
285 }
286 
287 Tool *ToolChain::getAssemble() const {
288  if (!Assemble)
289  Assemble.reset(buildAssembler());
290  return Assemble.get();
291 }
292 
293 Tool *ToolChain::getClangAs() const {
294  if (!Assemble)
295  Assemble.reset(new tools::ClangAs(*this));
296  return Assemble.get();
297 }
298 
299 Tool *ToolChain::getLink() const {
300  if (!Link)
301  Link.reset(buildLinker());
302  return Link.get();
303 }
304 
305 Tool *ToolChain::getStaticLibTool() const {
306  if (!StaticLibTool)
307  StaticLibTool.reset(buildStaticLibTool());
308  return StaticLibTool.get();
309 }
310 
311 Tool *ToolChain::getIfsMerge() const {
312  if (!IfsMerge)
313  IfsMerge.reset(new tools::ifstool::Merger(*this));
314  return IfsMerge.get();
315 }
316 
317 Tool *ToolChain::getOffloadBundler() const {
318  if (!OffloadBundler)
319  OffloadBundler.reset(new tools::OffloadBundler(*this));
320  return OffloadBundler.get();
321 }
322 
323 Tool *ToolChain::getOffloadWrapper() const {
324  if (!OffloadWrapper)
325  OffloadWrapper.reset(new tools::OffloadWrapper(*this));
326  return OffloadWrapper.get();
327 }
328 
330  switch (AC) {
332  return getAssemble();
333 
335  return getIfsMerge();
336 
338  return getLink();
339 
341  return getStaticLibTool();
342 
343  case Action::InputClass:
349  llvm_unreachable("Invalid tool kind.");
350 
359  return getClang();
360 
363  return getOffloadBundler();
364 
366  return getOffloadWrapper();
367  }
368 
369  llvm_unreachable("Invalid tool kind.");
370 }
371 
372 static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
373  const ArgList &Args) {
374  const llvm::Triple &Triple = TC.getTriple();
375  bool IsWindows = Triple.isOSWindows();
376 
377  if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
378  return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
379  ? "armhf"
380  : "arm";
381 
382  // For historic reasons, Android library is using i686 instead of i386.
383  if (TC.getArch() == llvm::Triple::x86 && Triple.isAndroid())
384  return "i686";
385 
386  if (TC.getArch() == llvm::Triple::x86_64 && Triple.isX32())
387  return "x32";
388 
389  return llvm::Triple::getArchTypeName(TC.getArch());
390 }
391 
392 StringRef ToolChain::getOSLibName() const {
393  if (Triple.isOSDarwin())
394  return "darwin";
395 
396  switch (Triple.getOS()) {
397  case llvm::Triple::FreeBSD:
398  return "freebsd";
399  case llvm::Triple::NetBSD:
400  return "netbsd";
401  case llvm::Triple::OpenBSD:
402  return "openbsd";
403  case llvm::Triple::Solaris:
404  return "sunos";
405  case llvm::Triple::AIX:
406  return "aix";
407  default:
408  return getOS();
409  }
410 }
411 
413  SmallString<128> Path(getDriver().ResourceDir);
414  if (Triple.isOSUnknown()) {
415  llvm::sys::path::append(Path, "lib");
416  } else {
417  llvm::sys::path::append(Path, "lib", getOSLibName());
418  }
419  return std::string(Path.str());
420 }
421 
423  StringRef Component,
424  FileType Type) const {
425  std::string CRTAbsolutePath = getCompilerRT(Args, Component, Type);
426  return llvm::sys::path::filename(CRTAbsolutePath).str();
427 }
428 
429 std::string ToolChain::buildCompilerRTBasename(const llvm::opt::ArgList &Args,
430  StringRef Component,
431  FileType Type,
432  bool AddArch) const {
433  const llvm::Triple &TT = getTriple();
434  bool IsITANMSVCWindows =
435  TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment();
436 
437  const char *Prefix =
438  IsITANMSVCWindows || Type == ToolChain::FT_Object ? "" : "lib";
439  const char *Suffix;
440  switch (Type) {
442  Suffix = IsITANMSVCWindows ? ".obj" : ".o";
443  break;
445  Suffix = IsITANMSVCWindows ? ".lib" : ".a";
446  break;
448  Suffix = TT.isOSWindows()
449  ? (TT.isWindowsGNUEnvironment() ? ".dll.a" : ".lib")
450  : ".so";
451  break;
452  }
453 
454  std::string ArchAndEnv;
455  if (AddArch) {
456  StringRef Arch = getArchNameForCompilerRTLib(*this, Args);
457  const char *Env = TT.isAndroid() ? "-android" : "";
458  ArchAndEnv = ("-" + Arch + Env).str();
459  }
460  return (Prefix + Twine("clang_rt.") + Component + ArchAndEnv + Suffix).str();
461 }
462 
463 std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
464  FileType Type) const {
465  // Check for runtime files in the new layout without the architecture first.
466  std::string CRTBasename =
467  buildCompilerRTBasename(Args, Component, Type, /*AddArch=*/false);
468  for (const auto &LibPath : getLibraryPaths()) {
469  SmallString<128> P(LibPath);
470  llvm::sys::path::append(P, CRTBasename);
471  if (getVFS().exists(P))
472  return std::string(P.str());
473  }
474 
475  // Fall back to the old expected compiler-rt name if the new one does not
476  // exist.
477  CRTBasename =
478  buildCompilerRTBasename(Args, Component, Type, /*AddArch=*/true);
480  llvm::sys::path::append(Path, CRTBasename);
481  return std::string(Path.str());
482 }
483 
484 const char *ToolChain::getCompilerRTArgString(const llvm::opt::ArgList &Args,
485  StringRef Component,
486  FileType Type) const {
487  return Args.MakeArgString(getCompilerRT(Args, Component, Type));
488 }
489 
492  llvm::sys::path::append(P, "lib", getTripleString());
493  return std::string(P.str());
494 }
495 
498  llvm::sys::path::append(P, "..", "lib", getTripleString());
499  return std::string(P.str());
500 }
501 
503  SmallString<128> Path(getDriver().ResourceDir);
504  llvm::sys::path::append(Path, "lib", getOSLibName(),
505  llvm::Triple::getArchTypeName(getArch()));
506  return std::string(Path.str());
507 }
508 
509 bool ToolChain::needsProfileRT(const ArgList &Args) {
510  if (Args.hasArg(options::OPT_noprofilelib))
511  return false;
512 
513  return Args.hasArg(options::OPT_fprofile_generate) ||
514  Args.hasArg(options::OPT_fprofile_generate_EQ) ||
515  Args.hasArg(options::OPT_fcs_profile_generate) ||
516  Args.hasArg(options::OPT_fcs_profile_generate_EQ) ||
517  Args.hasArg(options::OPT_fprofile_instr_generate) ||
518  Args.hasArg(options::OPT_fprofile_instr_generate_EQ) ||
519  Args.hasArg(options::OPT_fcreate_profile) ||
520  Args.hasArg(options::OPT_forder_file_instrumentation);
521 }
522 
523 bool ToolChain::needsGCovInstrumentation(const llvm::opt::ArgList &Args) {
524  return Args.hasArg(options::OPT_coverage) ||
525  Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
526  false);
527 }
528 
530  if (D.IsFlangMode() && getDriver().ShouldUseFlangCompiler(JA)) return getFlang();
531  if (getDriver().ShouldUseClangCompiler(JA)) return getClang();
532  Action::ActionClass AC = JA.getKind();
534  return getClangAs();
535  return getTool(AC);
536 }
537 
538 std::string ToolChain::GetFilePath(const char *Name) const {
539  return D.GetFilePath(Name, *this);
540 }
541 
542 std::string ToolChain::GetProgramPath(const char *Name) const {
543  return D.GetProgramPath(Name, *this);
544 }
545 
547  bool *LinkerIsLLDDarwinNew) const {
548  if (LinkerIsLLD)
549  *LinkerIsLLD = false;
550  if (LinkerIsLLDDarwinNew)
551  *LinkerIsLLDDarwinNew = false;
552 
553  // Get -fuse-ld= first to prevent -Wunused-command-line-argument. -fuse-ld= is
554  // considered as the linker flavor, e.g. "bfd", "gold", or "lld".
555  const Arg* A = Args.getLastArg(options::OPT_fuse_ld_EQ);
556  StringRef UseLinker = A ? A->getValue() : CLANG_DEFAULT_LINKER;
557 
558  // --ld-path= takes precedence over -fuse-ld= and specifies the executable
559  // name. -B, COMPILER_PATH and PATH and consulted if the value does not
560  // contain a path component separator.
561  if (const Arg *A = Args.getLastArg(options::OPT_ld_path_EQ)) {
562  std::string Path(A->getValue());
563  if (!Path.empty()) {
564  if (llvm::sys::path::parent_path(Path).empty())
565  Path = GetProgramPath(A->getValue());
566  if (llvm::sys::fs::can_execute(Path))
567  return std::string(Path);
568  }
569  getDriver().Diag(diag::err_drv_invalid_linker_name) << A->getAsString(Args);
571  }
572  // If we're passed -fuse-ld= with no argument, or with the argument ld,
573  // then use whatever the default system linker is.
574  if (UseLinker.empty() || UseLinker == "ld") {
575  const char *DefaultLinker = getDefaultLinker();
576  if (llvm::sys::path::is_absolute(DefaultLinker))
577  return std::string(DefaultLinker);
578  else
579  return GetProgramPath(DefaultLinker);
580  }
581 
582  // Extending -fuse-ld= to an absolute or relative path is unexpected. Checking
583  // for the linker flavor is brittle. In addition, prepending "ld." or "ld64."
584  // to a relative path is surprising. This is more complex due to priorities
585  // among -B, COMPILER_PATH and PATH. --ld-path= should be used instead.
586  if (UseLinker.contains('/'))
587  getDriver().Diag(diag::warn_drv_fuse_ld_path);
588 
589  if (llvm::sys::path::is_absolute(UseLinker)) {
590  // If we're passed what looks like an absolute path, don't attempt to
591  // second-guess that.
592  if (llvm::sys::fs::can_execute(UseLinker))
593  return std::string(UseLinker);
594  } else {
595  llvm::SmallString<8> LinkerName;
596  if (Triple.isOSDarwin())
597  LinkerName.append("ld64.");
598  else
599  LinkerName.append("ld.");
600  LinkerName.append(UseLinker);
601 
602  std::string LinkerPath(GetProgramPath(LinkerName.c_str()));
603  if (llvm::sys::fs::can_execute(LinkerPath)) {
604  // FIXME: Remove LinkerIsLLDDarwinNew once there's only one MachO lld.
605  if (LinkerIsLLD)
606  *LinkerIsLLD = UseLinker == "lld" || UseLinker == "lld.darwinold";
607  if (LinkerIsLLDDarwinNew)
608  *LinkerIsLLDDarwinNew = UseLinker == "lld";
609  return LinkerPath;
610  }
611  }
612 
613  if (A)
614  getDriver().Diag(diag::err_drv_invalid_linker_name) << A->getAsString(Args);
615 
617 }
618 
620  // TODO: Add support for static lib archiving on Windows
621  if (Triple.isOSDarwin())
622  return GetProgramPath("libtool");
623  return GetProgramPath("llvm-ar");
624 }
625 
628 
629  // Flang always runs the preprocessor and has no notion of "preprocessed
630  // fortran". Here, TY_PP_Fortran is coerced to TY_Fortran to avoid treating
631  // them differently.
632  if (D.IsFlangMode() && id == types::TY_PP_Fortran)
633  id = types::TY_Fortran;
634 
635  return id;
636 }
637 
639  return false;
640 }
641 
643  llvm::Triple HostTriple(LLVM_HOST_TRIPLE);
644  switch (HostTriple.getArch()) {
645  // The A32/T32/T16 instruction sets are not separate architectures in this
646  // context.
647  case llvm::Triple::arm:
648  case llvm::Triple::armeb:
649  case llvm::Triple::thumb:
650  case llvm::Triple::thumbeb:
651  return getArch() != llvm::Triple::arm && getArch() != llvm::Triple::thumb &&
652  getArch() != llvm::Triple::armeb && getArch() != llvm::Triple::thumbeb;
653  default:
654  return HostTriple.getArch() != getArch();
655  }
656 }
657 
659  return ObjCRuntime(isNonFragile ? ObjCRuntime::GNUstep : ObjCRuntime::GCC,
660  VersionTuple());
661 }
662 
663 llvm::ExceptionHandling
664 ToolChain::GetExceptionModel(const llvm::opt::ArgList &Args) const {
666 }
667 
668 bool ToolChain::isThreadModelSupported(const StringRef Model) const {
669  if (Model == "single") {
670  // FIXME: 'single' is only supported on ARM and WebAssembly so far.
671  return Triple.getArch() == llvm::Triple::arm ||
672  Triple.getArch() == llvm::Triple::armeb ||
673  Triple.getArch() == llvm::Triple::thumb ||
674  Triple.getArch() == llvm::Triple::thumbeb || Triple.isWasm();
675  } else if (Model == "posix")
676  return true;
677 
678  return false;
679 }
680 
682  types::ID InputType) const {
683  switch (getTriple().getArch()) {
684  default:
685  return getTripleString();
686 
687  case llvm::Triple::x86_64: {
688  llvm::Triple Triple = getTriple();
689  if (!Triple.isOSBinFormatMachO())
690  return getTripleString();
691 
692  if (Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
693  // x86_64h goes in the triple. Other -march options just use the
694  // vanilla triple we already have.
695  StringRef MArch = A->getValue();
696  if (MArch == "x86_64h")
697  Triple.setArchName(MArch);
698  }
699  return Triple.getTriple();
700  }
701  case llvm::Triple::aarch64: {
702  llvm::Triple Triple = getTriple();
703  if (!Triple.isOSBinFormatMachO())
704  return getTripleString();
705 
706  if (Triple.isArm64e())
707  return getTripleString();
708 
709  // FIXME: older versions of ld64 expect the "arm64" component in the actual
710  // triple string and query it to determine whether an LTO file can be
711  // handled. Remove this when we don't care any more.
712  Triple.setArchName("arm64");
713  return Triple.getTriple();
714  }
715  case llvm::Triple::aarch64_32:
716  return getTripleString();
717  case llvm::Triple::arm:
718  case llvm::Triple::armeb:
719  case llvm::Triple::thumb:
720  case llvm::Triple::thumbeb: {
721  llvm::Triple Triple = getTriple();
722  tools::arm::setArchNameInTriple(getDriver(), Args, InputType, Triple);
724  return Triple.getTriple();
725  }
726  }
727 }
728 
730  types::ID InputType) const {
731  return ComputeLLVMTriple(Args, InputType);
732 }
733 
735  return D.SysRoot;
736 }
737 
738 void ToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
739  ArgStringList &CC1Args) const {
740  // Each toolchain should provide the appropriate include flags.
741 }
742 
744  const ArgList &DriverArgs, ArgStringList &CC1Args,
745  Action::OffloadKind DeviceOffloadKind) const {}
746 
747 void ToolChain::addClangWarningOptions(ArgStringList &CC1Args) const {}
748 
749 void ToolChain::addProfileRTLibs(const llvm::opt::ArgList &Args,
750  llvm::opt::ArgStringList &CmdArgs) const {
751  if (!needsProfileRT(Args) && !needsGCovInstrumentation(Args))
752  return;
753 
754  CmdArgs.push_back(getCompilerRTArgString(Args, "profile"));
755 }
756 
758  const ArgList &Args) const {
759  if (runtimeLibType)
760  return *runtimeLibType;
761 
762  const Arg* A = Args.getLastArg(options::OPT_rtlib_EQ);
763  StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_RTLIB;
764 
765  // Only use "platform" in tests to override CLANG_DEFAULT_RTLIB!
766  if (LibName == "compiler-rt")
767  runtimeLibType = ToolChain::RLT_CompilerRT;
768  else if (LibName == "libgcc")
769  runtimeLibType = ToolChain::RLT_Libgcc;
770  else if (LibName == "platform")
771  runtimeLibType = GetDefaultRuntimeLibType();
772  else {
773  if (A)
774  getDriver().Diag(diag::err_drv_invalid_rtlib_name)
775  << A->getAsString(Args);
776 
777  runtimeLibType = GetDefaultRuntimeLibType();
778  }
779 
780  return *runtimeLibType;
781 }
782 
784  const ArgList &Args) const {
785  if (unwindLibType)
786  return *unwindLibType;
787 
788  const Arg *A = Args.getLastArg(options::OPT_unwindlib_EQ);
789  StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_UNWINDLIB;
790 
791  if (LibName == "none")
792  unwindLibType = ToolChain::UNW_None;
793  else if (LibName == "platform" || LibName == "") {
795  if (RtLibType == ToolChain::RLT_CompilerRT) {
796  if (getTriple().isAndroid() || getTriple().isOSAIX())
797  unwindLibType = ToolChain::UNW_CompilerRT;
798  else
799  unwindLibType = ToolChain::UNW_None;
800  } else if (RtLibType == ToolChain::RLT_Libgcc)
801  unwindLibType = ToolChain::UNW_Libgcc;
802  } else if (LibName == "libunwind") {
803  if (GetRuntimeLibType(Args) == RLT_Libgcc)
804  getDriver().Diag(diag::err_drv_incompatible_unwindlib);
805  unwindLibType = ToolChain::UNW_CompilerRT;
806  } else if (LibName == "libgcc")
807  unwindLibType = ToolChain::UNW_Libgcc;
808  else {
809  if (A)
810  getDriver().Diag(diag::err_drv_invalid_unwindlib_name)
811  << A->getAsString(Args);
812 
813  unwindLibType = GetDefaultUnwindLibType();
814  }
815 
816  return *unwindLibType;
817 }
818 
820  if (cxxStdlibType)
821  return *cxxStdlibType;
822 
823  const Arg *A = Args.getLastArg(options::OPT_stdlib_EQ);
824  StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_CXX_STDLIB;
825 
826  // Only use "platform" in tests to override CLANG_DEFAULT_CXX_STDLIB!
827  if (LibName == "libc++")
828  cxxStdlibType = ToolChain::CST_Libcxx;
829  else if (LibName == "libstdc++")
830  cxxStdlibType = ToolChain::CST_Libstdcxx;
831  else if (LibName == "platform")
832  cxxStdlibType = GetDefaultCXXStdlibType();
833  else {
834  if (A)
835  getDriver().Diag(diag::err_drv_invalid_stdlib_name)
836  << A->getAsString(Args);
837 
838  cxxStdlibType = GetDefaultCXXStdlibType();
839  }
840 
841  return *cxxStdlibType;
842 }
843 
844 /// Utility function to add a system include directory to CC1 arguments.
845 /*static*/ void ToolChain::addSystemInclude(const ArgList &DriverArgs,
846  ArgStringList &CC1Args,
847  const Twine &Path) {
848  CC1Args.push_back("-internal-isystem");
849  CC1Args.push_back(DriverArgs.MakeArgString(Path));
850 }
851 
852 /// Utility function to add a system include directory with extern "C"
853 /// semantics to CC1 arguments.
854 ///
855 /// Note that this should be used rarely, and only for directories that
856 /// historically and for legacy reasons are treated as having implicit extern
857 /// "C" semantics. These semantics are *ignored* by and large today, but its
858 /// important to preserve the preprocessor changes resulting from the
859 /// classification.
860 /*static*/ void ToolChain::addExternCSystemInclude(const ArgList &DriverArgs,
861  ArgStringList &CC1Args,
862  const Twine &Path) {
863  CC1Args.push_back("-internal-externc-isystem");
864  CC1Args.push_back(DriverArgs.MakeArgString(Path));
865 }
866 
867 void ToolChain::addExternCSystemIncludeIfExists(const ArgList &DriverArgs,
868  ArgStringList &CC1Args,
869  const Twine &Path) {
870  if (llvm::sys::fs::exists(Path))
871  addExternCSystemInclude(DriverArgs, CC1Args, Path);
872 }
873 
874 /// Utility function to add a list of system include directories to CC1.
875 /*static*/ void ToolChain::addSystemIncludes(const ArgList &DriverArgs,
876  ArgStringList &CC1Args,
877  ArrayRef<StringRef> Paths) {
878  for (const auto &Path : Paths) {
879  CC1Args.push_back("-internal-isystem");
880  CC1Args.push_back(DriverArgs.MakeArgString(Path));
881  }
882 }
883 
884 std::string ToolChain::detectLibcxxVersion(StringRef IncludePath) const {
885  std::error_code EC;
886  int MaxVersion = 0;
887  std::string MaxVersionString;
888  SmallString<128> Path(IncludePath);
889  llvm::sys::path::append(Path, "c++");
890  for (llvm::vfs::directory_iterator LI = getVFS().dir_begin(Path, EC), LE;
891  !EC && LI != LE; LI = LI.increment(EC)) {
892  StringRef VersionText = llvm::sys::path::filename(LI->path());
893  int Version;
894  if (VersionText[0] == 'v' &&
895  !VersionText.slice(1, StringRef::npos).getAsInteger(10, Version)) {
896  if (Version > MaxVersion) {
897  MaxVersion = Version;
898  MaxVersionString = std::string(VersionText);
899  }
900  }
901  }
902  if (!MaxVersion)
903  return "";
904  return MaxVersionString;
905 }
906 
907 void ToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
908  ArgStringList &CC1Args) const {
909  // Header search paths should be handled by each of the subclasses.
910  // Historically, they have not been, and instead have been handled inside of
911  // the CC1-layer frontend. As the logic is hoisted out, this generic function
912  // will slowly stop being called.
913  //
914  // While it is being called, replicate a bit of a hack to propagate the
915  // '-stdlib=' flag down to CC1 so that it can in turn customize the C++
916  // header search paths with it. Once all systems are overriding this
917  // function, the CC1 flag and this line can be removed.
918  DriverArgs.AddAllArgs(CC1Args, options::OPT_stdlib_EQ);
919 }
920 
922  const llvm::opt::ArgList &DriverArgs,
923  llvm::opt::ArgStringList &CC1Args) const {
924  DriverArgs.ClaimAllArgs(options::OPT_stdlibxx_isystem);
925  if (!DriverArgs.hasArg(options::OPT_nostdinc, options::OPT_nostdincxx,
926  options::OPT_nostdlibinc))
927  for (const auto &P :
928  DriverArgs.getAllArgValues(options::OPT_stdlibxx_isystem))
929  addSystemInclude(DriverArgs, CC1Args, P);
930 }
931 
932 bool ToolChain::ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const {
933  return getDriver().CCCIsCXX() &&
934  !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
935  options::OPT_nostdlibxx);
936 }
937 
938 void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
939  ArgStringList &CmdArgs) const {
940  assert(!Args.hasArg(options::OPT_nostdlibxx) &&
941  "should not have called this");
943 
944  switch (Type) {
946  CmdArgs.push_back("-lc++");
947  break;
948 
950  CmdArgs.push_back("-lstdc++");
951  break;
952  }
953 }
954 
955 void ToolChain::AddFilePathLibArgs(const ArgList &Args,
956  ArgStringList &CmdArgs) const {
957  for (const auto &LibPath : getFilePaths())
958  if(LibPath.length() > 0)
959  CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
960 }
961 
962 void ToolChain::AddCCKextLibArgs(const ArgList &Args,
963  ArgStringList &CmdArgs) const {
964  CmdArgs.push_back("-lcc_kext");
965 }
966 
967 bool ToolChain::isFastMathRuntimeAvailable(const ArgList &Args,
968  std::string &Path) const {
969  // Do not check for -fno-fast-math or -fno-unsafe-math when -Ofast passed
970  // (to keep the linker options consistent with gcc and clang itself).
971  if (!isOptimizationLevelFast(Args)) {
972  // Check if -ffast-math or -funsafe-math.
973  Arg *A =
974  Args.getLastArg(options::OPT_ffast_math, options::OPT_fno_fast_math,
975  options::OPT_funsafe_math_optimizations,
976  options::OPT_fno_unsafe_math_optimizations);
977 
978  if (!A || A->getOption().getID() == options::OPT_fno_fast_math ||
979  A->getOption().getID() == options::OPT_fno_unsafe_math_optimizations)
980  return false;
981  }
982  // If crtfastmath.o exists add it to the arguments.
983  Path = GetFilePath("crtfastmath.o");
984  return (Path != "crtfastmath.o"); // Not found.
985 }
986 
988  ArgStringList &CmdArgs) const {
989  std::string Path;
990  if (isFastMathRuntimeAvailable(Args, Path)) {
991  CmdArgs.push_back(Args.MakeArgString(Path));
992  return true;
993  }
994 
995  return false;
996 }
997 
999  // Return sanitizers which don't require runtime support and are not
1000  // platform dependent.
1001 
1002  SanitizerMask Res =
1003  (SanitizerKind::Undefined & ~SanitizerKind::Vptr &
1004  ~SanitizerKind::Function) |
1005  (SanitizerKind::CFI & ~SanitizerKind::CFIICall) |
1006  SanitizerKind::CFICastStrict | SanitizerKind::FloatDivideByZero |
1007  SanitizerKind::UnsignedIntegerOverflow |
1008  SanitizerKind::UnsignedShiftBase | SanitizerKind::ImplicitConversion |
1009  SanitizerKind::Nullability | SanitizerKind::LocalBounds;
1010  if (getTriple().getArch() == llvm::Triple::x86 ||
1011  getTriple().getArch() == llvm::Triple::x86_64 ||
1012  getTriple().getArch() == llvm::Triple::arm || getTriple().isWasm() ||
1013  getTriple().isAArch64())
1014  Res |= SanitizerKind::CFIICall;
1015  if (getTriple().getArch() == llvm::Triple::x86_64 ||
1016  getTriple().isAArch64(64) || getTriple().isRISCV())
1017  Res |= SanitizerKind::ShadowCallStack;
1018  if (getTriple().isAArch64(64))
1019  Res |= SanitizerKind::MemTag;
1020  return Res;
1021 }
1022 
1023 void ToolChain::AddCudaIncludeArgs(const ArgList &DriverArgs,
1024  ArgStringList &CC1Args) const {}
1025 
1026 void ToolChain::AddHIPIncludeArgs(const ArgList &DriverArgs,
1027  ArgStringList &CC1Args) const {}
1028 
1030 ToolChain::getHIPDeviceLibs(const ArgList &DriverArgs) const {
1031  return {};
1032 }
1033 
1034 void ToolChain::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
1035  ArgStringList &CC1Args) const {}
1036 
1037 static VersionTuple separateMSVCFullVersion(unsigned Version) {
1038  if (Version < 100)
1039  return VersionTuple(Version);
1040 
1041  if (Version < 10000)
1042  return VersionTuple(Version / 100, Version % 100);
1043 
1044  unsigned Build = 0, Factor = 1;
1045  for (; Version > 10000; Version = Version / 10, Factor = Factor * 10)
1046  Build = Build + (Version % 10) * Factor;
1047  return VersionTuple(Version / 100, Version % 100, Build);
1048 }
1049 
1050 VersionTuple
1052  const llvm::opt::ArgList &Args) const {
1053  const Arg *MSCVersion = Args.getLastArg(options::OPT_fmsc_version);
1054  const Arg *MSCompatibilityVersion =
1055  Args.getLastArg(options::OPT_fms_compatibility_version);
1056 
1057  if (MSCVersion && MSCompatibilityVersion) {
1058  if (D)
1059  D->Diag(diag::err_drv_argument_not_allowed_with)
1060  << MSCVersion->getAsString(Args)
1061  << MSCompatibilityVersion->getAsString(Args);
1062  return VersionTuple();
1063  }
1064 
1065  if (MSCompatibilityVersion) {
1066  VersionTuple MSVT;
1067  if (MSVT.tryParse(MSCompatibilityVersion->getValue())) {
1068  if (D)
1069  D->Diag(diag::err_drv_invalid_value)
1070  << MSCompatibilityVersion->getAsString(Args)
1071  << MSCompatibilityVersion->getValue();
1072  } else {
1073  return MSVT;
1074  }
1075  }
1076 
1077  if (MSCVersion) {
1078  unsigned Version = 0;
1079  if (StringRef(MSCVersion->getValue()).getAsInteger(10, Version)) {
1080  if (D)
1081  D->Diag(diag::err_drv_invalid_value)
1082  << MSCVersion->getAsString(Args) << MSCVersion->getValue();
1083  } else {
1084  return separateMSVCFullVersion(Version);
1085  }
1086  }
1087 
1088  return VersionTuple();
1089 }
1090 
1091 llvm::opt::DerivedArgList *ToolChain::TranslateOpenMPTargetArgs(
1092  const llvm::opt::DerivedArgList &Args, bool SameTripleAsHost,
1093  SmallVectorImpl<llvm::opt::Arg *> &AllocatedArgs) const {
1094  DerivedArgList *DAL = new DerivedArgList(Args.getBaseArgs());
1095  const OptTable &Opts = getDriver().getOpts();
1096  bool Modified = false;
1097 
1098  // Handle -Xopenmp-target flags
1099  for (auto *A : Args) {
1100  // Exclude flags which may only apply to the host toolchain.
1101  // Do not exclude flags when the host triple (AuxTriple)
1102  // matches the current toolchain triple. If it is not present
1103  // at all, target and host share a toolchain.
1104  if (A->getOption().matches(options::OPT_m_Group)) {
1105  if (SameTripleAsHost)
1106  DAL->append(A);
1107  else
1108  Modified = true;
1109  continue;
1110  }
1111 
1112  unsigned Index;
1113  unsigned Prev;
1114  bool XOpenMPTargetNoTriple =
1115  A->getOption().matches(options::OPT_Xopenmp_target);
1116 
1117  if (A->getOption().matches(options::OPT_Xopenmp_target_EQ)) {
1118  // Passing device args: -Xopenmp-target=<triple> -opt=val.
1119  if (A->getValue(0) == getTripleString())
1120  Index = Args.getBaseArgs().MakeIndex(A->getValue(1));
1121  else
1122  continue;
1123  } else if (XOpenMPTargetNoTriple) {
1124  // Passing device args: -Xopenmp-target -opt=val.
1125  Index = Args.getBaseArgs().MakeIndex(A->getValue(0));
1126  } else {
1127  DAL->append(A);
1128  continue;
1129  }
1130 
1131  // Parse the argument to -Xopenmp-target.
1132  Prev = Index;
1133  std::unique_ptr<Arg> XOpenMPTargetArg(Opts.ParseOneArg(Args, Index));
1134  if (!XOpenMPTargetArg || Index > Prev + 1) {
1135  getDriver().Diag(diag::err_drv_invalid_Xopenmp_target_with_args)
1136  << A->getAsString(Args);
1137  continue;
1138  }
1139  if (XOpenMPTargetNoTriple && XOpenMPTargetArg &&
1140  Args.getAllArgValues(options::OPT_fopenmp_targets_EQ).size() != 1) {
1141  getDriver().Diag(diag::err_drv_Xopenmp_target_missing_triple);
1142  continue;
1143  }
1144  XOpenMPTargetArg->setBaseArg(A);
1145  A = XOpenMPTargetArg.release();
1146  AllocatedArgs.push_back(A);
1147  DAL->append(A);
1148  Modified = true;
1149  }
1150 
1151  if (Modified)
1152  return DAL;
1153 
1154  delete DAL;
1155  return nullptr;
1156 }
1157 
1158 // TODO: Currently argument values separated by space e.g.
1159 // -Xclang -mframe-pointer=no cannot be passed by -Xarch_. This should be
1160 // fixed.
1162  const llvm::opt::DerivedArgList &Args, llvm::opt::Arg *&A,
1163  llvm::opt::DerivedArgList *DAL,
1164  SmallVectorImpl<llvm::opt::Arg *> *AllocatedArgs) const {
1165  const OptTable &Opts = getDriver().getOpts();
1166  unsigned ValuePos = 1;
1167  if (A->getOption().matches(options::OPT_Xarch_device) ||
1168  A->getOption().matches(options::OPT_Xarch_host))
1169  ValuePos = 0;
1170 
1171  unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(ValuePos));
1172  unsigned Prev = Index;
1173  std::unique_ptr<llvm::opt::Arg> XarchArg(Opts.ParseOneArg(Args, Index));
1174 
1175  // If the argument parsing failed or more than one argument was
1176  // consumed, the -Xarch_ argument's parameter tried to consume
1177  // extra arguments. Emit an error and ignore.
1178  //
1179  // We also want to disallow any options which would alter the
1180  // driver behavior; that isn't going to work in our model. We
1181  // use options::NoXarchOption to control this.
1182  if (!XarchArg || Index > Prev + 1) {
1183  getDriver().Diag(diag::err_drv_invalid_Xarch_argument_with_args)
1184  << A->getAsString(Args);
1185  return;
1186  } else if (XarchArg->getOption().hasFlag(options::NoXarchOption)) {
1187  auto &Diags = getDriver().getDiags();
1188  unsigned DiagID =
1190  "invalid Xarch argument: '%0', not all driver "
1191  "options can be forwared via Xarch argument");
1192  Diags.Report(DiagID) << A->getAsString(Args);
1193  return;
1194  }
1195  XarchArg->setBaseArg(A);
1196  A = XarchArg.release();
1197  if (!AllocatedArgs)
1198  DAL->AddSynthesizedArg(A);
1199  else
1200  AllocatedArgs->push_back(A);
1201 }
1202 
1203 llvm::opt::DerivedArgList *ToolChain::TranslateXarchArgs(
1204  const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
1205  Action::OffloadKind OFK,
1206  SmallVectorImpl<llvm::opt::Arg *> *AllocatedArgs) const {
1207  DerivedArgList *DAL = new DerivedArgList(Args.getBaseArgs());
1208  bool Modified = false;
1209 
1210  bool IsGPU = OFK == Action::OFK_Cuda || OFK == Action::OFK_HIP;
1211  for (Arg *A : Args) {
1212  bool NeedTrans = false;
1213  bool Skip = false;
1214  if (A->getOption().matches(options::OPT_Xarch_device)) {
1215  NeedTrans = IsGPU;
1216  Skip = !IsGPU;
1217  } else if (A->getOption().matches(options::OPT_Xarch_host)) {
1218  NeedTrans = !IsGPU;
1219  Skip = IsGPU;
1220  } else if (A->getOption().matches(options::OPT_Xarch__) && IsGPU) {
1221  // Do not translate -Xarch_ options for non CUDA/HIP toolchain since
1222  // they may need special translation.
1223  // Skip this argument unless the architecture matches BoundArch
1224  if (BoundArch.empty() || A->getValue(0) != BoundArch)
1225  Skip = true;
1226  else
1227  NeedTrans = true;
1228  }
1229  if (NeedTrans || Skip)
1230  Modified = true;
1231  if (NeedTrans)
1232  TranslateXarchArgs(Args, A, DAL, AllocatedArgs);
1233  if (!Skip)
1234  DAL->append(A);
1235  }
1236 
1237  if (Modified)
1238  return DAL;
1239 
1240  delete DAL;
1241  return nullptr;
1242 }
clang::driver::ToolChain::buildStaticLibTool
virtual Tool * buildStaticLibTool() const
Definition: ToolChain.cpp:283
clang::driver::ToolChain::getSanitizerArgs
const SanitizerArgs & getSanitizerArgs() const
Definition: ToolChain.cpp:117
clang::driver::Driver::GetProgramPath
std::string GetProgramPath(StringRef Name, const ToolChain &TC) const
GetProgramPath - Lookup Name in the list of program search paths.
Definition: Driver.cpp:5179
llvm
Definition: Dominators.h:30
clang::driver::isOptimizationLevelFast
bool isOptimizationLevelFast(const llvm::opt::ArgList &Args)
clang::driver::ToolChain::getCompilerRT
virtual std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
Definition: ToolChain.cpp:463
clang::driver::ToolChain::getVFS
llvm::vfs::FileSystem & getVFS() const
Definition: ToolChain.cpp:99
XRayArgs.h
ObjCRuntime.h
clang::driver::tools::arm::setFloatABIInTriple
void setFloatABIInTriple(const Driver &D, const llvm::opt::ArgList &Args, llvm::Triple &triple)
clang::driver::ParsedClangName
Helper structure used to pass information extracted from clang executable name such as i686-linux-and...
Definition: ToolChain.h:64
clang::ento::Nullability
Nullability
Definition: CheckerHelpers.h:56
clang::ObjCRuntime::GCC
@ GCC
'gcc' is the Objective-C runtime shipped with GCC, implementing a fragile Objective-C ABI
Definition: ObjCRuntime.h:53
Driver.h
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::driver::Driver::Dir
std::string Dir
The path the driver executable was in, as invoked from the command line.
Definition: Driver.h:123
clang::driver::ToolChain::getDefaultLinker
virtual const char * getDefaultLinker() const
GetDefaultLinker - Get the default linker to use.
Definition: ToolChain.h:426
clang::driver::ToolChain::getTargetAndModeFromProgramName
static ParsedClangName getTargetAndModeFromProgramName(StringRef ProgName)
Return any implicit target and/or mode flag for an invocation of the compiler driver as ProgName.
Definition: ToolChain.cpp:206
clang::driver::ToolChain::computeMSVCVersion
virtual VersionTuple computeMSVCVersion(const Driver *D, const llvm::opt::ArgList &Args) const
On Windows, returns the MSVC compatibility version.
Definition: ToolChain.cpp:1051
clang::driver::ToolChain::buildCompilerRTBasename
virtual std::string buildCompilerRTBasename(const llvm::opt::ArgList &Args, StringRef Component, FileType Type, bool AddArch) const
Definition: ToolChain.cpp:429
clang::driver::Action::OFK_Cuda
@ OFK_Cuda
Definition: Action.h:92
clang::driver::ToolChain::getDefaultObjCRuntime
virtual ObjCRuntime getDefaultObjCRuntime(bool isNonFragile) const
getDefaultObjCRuntime - Return the default Objective-C runtime for this platform.
Definition: ToolChain.cpp:658
clang::driver::ToolChain::TranslateXarchArgs
virtual void TranslateXarchArgs(const llvm::opt::DerivedArgList &Args, llvm::opt::Arg *&A, llvm::opt::DerivedArgList *DAL, SmallVectorImpl< llvm::opt::Arg * > *AllocatedArgs=nullptr) const
Append the argument following A to DAL assuming A is an Xarch argument.
Definition: ToolChain.cpp:1161
llvm::SmallVector
Definition: LLVM.h:38
clang::driver::tools::arm::getARMFloatABI
FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args)
clang::driver::Action::ActionClass
ActionClass
Definition: Action.h:55
clang::driver::ToolChain::needsProfileRT
static bool needsProfileRT(const llvm::opt::ArgList &Args)
needsProfileRT - returns true if instrumentation profile is on.
Definition: ToolChain.cpp:509
clang::driver::Action::getKind
ActionClass getKind() const
Definition: Action.h:142
clang::driver::ToolChain::GetProgramPath
std::string GetProgramPath(const char *Name) const
Definition: ToolChain.cpp:542
clang::driver::Action::LipoJobClass
@ LipoJobClass
Definition: Action.h:69
clang::driver::ToolChain::AddClangCXXStdlibIncludeArgs
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:907
clang::driver::ToolChain::getDefaultUniversalArchName
StringRef getDefaultUniversalArchName() const
Provide the default architecture name (as expected by -arch) for this toolchain.
Definition: ToolChain.cpp:230
clang::driver::ToolChain::getDriver
const Driver & getDriver() const
Definition: ToolChain.h:221
Job.h
clang::driver::ToolChain::detectLibcxxVersion
virtual std::string detectLibcxxVersion(StringRef IncludePath) const
Definition: ToolChain.cpp:884
parseDriverSuffix
static const DriverSuffix * parseDriverSuffix(StringRef ProgName, size_t &Pos)
Definition: ToolChain.cpp:179
clang::driver::Action::OffloadBundlingJobClass
@ OffloadBundlingJobClass
Definition: Action.h:73
clang::driver::ToolChain::FT_Object
@ FT_Object
Definition: ToolChain.h:123
clang::driver::tools::ClangAs
Clang integrated assembler tool.
Definition: Clang.h:117
clang::driver::ToolChain::getTripleString
std::string getTripleString() const
Definition: ToolChain.h:246
clang::driver::Action::OFK_HIP
@ OFK_HIP
Definition: Action.h:94
clang::driver::ToolChain::addFastMathRuntimeIfAvailable
bool addFastMathRuntimeIfAvailable(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddFastMathRuntimeIfAvailable - If a runtime library exists that sets global flags for unsafe floatin...
Definition: ToolChain.cpp:987
clang::driver::ToolChain::getCompilerRTPath
virtual std::string getCompilerRTPath() const
Definition: ToolChain.cpp:412
clang::driver::Action::AssembleJobClass
@ AssembleJobClass
Definition: Action.h:66
clang::driver::ToolChain::HasNativeLLVMSupport
virtual bool HasNativeLLVMSupport() const
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition: ToolChain.cpp:638
clang::driver::ToolChain::GetFilePath
std::string GetFilePath(const char *Name) const
Definition: ToolChain.cpp:538
clang::driver::ToolChain::addClangWarningOptions
virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const
Add warning options that need to be passed to cc1 for this target.
Definition: ToolChain.cpp:747
clang::driver::ToolChain::GetLinkerPath
std::string GetLinkerPath(bool *LinkerIsLLD=nullptr, bool *LinkerIsLLDDarwinNew=nullptr) const
Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name.
Definition: ToolChain.cpp:546
clang::driver::Driver::getOpts
const llvm::opt::OptTable & getOpts() const
Definition: Driver.h:325
clang::driver::ToolChain::getInputFilename
virtual std::string getInputFilename(const InputInfo &Input) const
Some toolchains need to modify the file name, for example to replace the extension for object files w...
Definition: ToolChain.cpp:255
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::ToolChain::addExternCSystemIncludeIfExists
static void addExternCSystemIncludeIfExists(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Definition: ToolChain.cpp:867
clang::driver::Driver::getDiags
DiagnosticsEngine & getDiags() const
Definition: Driver.h:327
clang::driver::ToolChain::RuntimeLibType
RuntimeLibType
Definition: ToolChain.h:100
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
InputInfo.h
clang::driver::XRayArgs
Definition: XRayArgs.h:21
clang::driver::types::lookupTypeForExtension
ID lookupTypeForExtension(llvm::StringRef Ext)
lookupTypeForExtension - Lookup the type to use for the file extension Ext.
Definition: Types.cpp:273
clang::driver::tools::arm::setArchNameInTriple
void setArchNameInTriple(const Driver &D, const llvm::opt::ArgList &Args, types::ID InputType, llvm::Triple &Triple)
Action.h
clang::driver::Action::PreprocessJobClass
@ PreprocessJobClass
Definition: Action.h:59
clang::driver::Action::DsymutilJobClass
@ DsymutilJobClass
Definition: Action.h:70
clang::driver::ToolChain::getFilePaths
path_list & getFilePaths()
Definition: ToolChain.h:259
clang::driver::Driver::Diag
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:112
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
clang::driver::ToolChain::ToolChain
ToolChain(const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args)
Definition: ToolChain.cpp:74
Options.h
clang::driver::ToolChain::getHIPDeviceLibs
virtual llvm::SmallVector< BitCodeLibraryInfo, 12 > getHIPDeviceLibs(const llvm::opt::ArgList &Args) const
Get paths of HIP device libraries.
Definition: ToolChain.cpp:1030
clang::XRayInstrKind::None
constexpr XRayInstrMask None
Definition: XRayInstr.h:38
clang::interp::LE
bool LE(InterpState &S, CodePtr OpPC)
Definition: Interp.h:239
getArchNameForCompilerRTLib
static StringRef getArchNameForCompilerRTLib(const ToolChain &TC, const ArgList &Args)
Definition: ToolChain.cpp:372
clang::driver::ToolChain::isFastMathRuntimeAvailable
virtual bool isFastMathRuntimeAvailable(const llvm::opt::ArgList &Args, std::string &Path) const
If a runtime library exists that sets global flags for unsafe floating point math,...
Definition: ToolChain.cpp:967
clang::driver::ToolChain::getOS
StringRef getOS() const
Definition: ToolChain.h:240
clang::driver::ToolChain::UNW_None
@ UNW_None
Definition: ToolChain.h:106
clang::driver::ToolChain::IsUnwindTablesDefault
virtual bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const
IsUnwindTablesDefault - Does this tool chain use -funwind-tables by default.
Definition: ToolChain.cpp:259
llvm::opt
Definition: DiagnosticOptions.h:19
DriverDiagnostic.h
clang::driver::Action::OffloadUnbundlingJobClass
@ OffloadUnbundlingJobClass
Definition: Action.h:74
FindDriverSuffix
static const DriverSuffix * FindDriverSuffix(StringRef ProgName, size_t &Pos)
Definition: ToolChain.cpp:138
clang::DiagnosticsEngine::Error
@ Error
Definition: Diagnostic.h:199
clang::driver::ToolChain::AddClangSystemIncludeArgs
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:738
clang::driver::ToolChain::RLT_Libgcc
@ RLT_Libgcc
Definition: ToolChain.h:102
clang::driver::ToolChain::AddCCKextLibArgs
virtual void AddCCKextLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddCCKextLibArgs - Add the system specific linker arguments to use for kernel extensions (Darwin-spec...
Definition: ToolChain.cpp:962
clang::driver::tools::OffloadWrapper
Offload wrapper tool.
Definition: Clang.h:156
clang::driver::ToolChain::CXXStdlibType
CXXStdlibType
Definition: ToolChain.h:95
Clang.h
llvm::SmallString< 128 >
clang::driver::ToolChain::getTriple
const llvm::Triple & getTriple() const
Definition: ToolChain.h:223
clang::driver::ToolChain::SelectTool
virtual Tool * SelectTool(const JobAction &JA) const
Choose a tool to use to handle the action JA.
Definition: ToolChain.cpp:529
InterfaceStubs.h
clang::driver::ToolChain::buildLinker
virtual Tool * buildLinker() const
Definition: ToolChain.cpp:279
clang::driver::Driver::SysRoot
std::string SysRoot
sysroot, if present
Definition: Driver.h:151
normalizeProgramName
static std::string normalizeProgramName(llvm::StringRef Argv0)
Normalize the program name from argv[0] by stripping the file extension if present and lower-casing t...
Definition: ToolChain.cpp:170
clang::driver::ToolChain::IsIntegratedAssemblerDefault
virtual bool IsIntegratedAssemblerDefault() const
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: ToolChain.h:385
clang::driver::tools::Clang
Clang compiler tool.
Definition: Clang.h:28
clang::driver::ToolChain::setTripleEnvironment
void setTripleEnvironment(llvm::Triple::EnvironmentType Env)
Definition: ToolChain.cpp:91
separateMSVCFullVersion
static VersionTuple separateMSVCFullVersion(unsigned Version)
Definition: ToolChain.cpp:1037
clang::driver::Action::OffloadClass
@ OffloadClass
Definition: Action.h:58
clang::driver::ToolChain::CST_Libcxx
@ CST_Libcxx
Definition: ToolChain.h:96
clang::driver::Driver::CCCIsCXX
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition: Driver.h:179
clang::driver::ToolChain::UNW_CompilerRT
@ UNW_CompilerRT
Definition: ToolChain.h:107
clang::driver::ToolChain::TranslateOpenMPTargetArgs
virtual llvm::opt::DerivedArgList * TranslateOpenMPTargetArgs(const llvm::opt::DerivedArgList &Args, bool SameTripleAsHost, SmallVectorImpl< llvm::opt::Arg * > &AllocatedArgs) const
TranslateOpenMPTargetArgs - Create a new derived argument list for that contains the OpenMP target sp...
Definition: ToolChain.cpp:1091
clang::driver::tools::Flang
Flang compiler tool.
Definition: Flang.h:25
clang::driver::SanitizerArgs
Definition: SanitizerArgs.h:24
SanitizerArgs.h
clang::driver::ToolChain::UNW_Libgcc
@ UNW_Libgcc
Definition: ToolChain.h:108
clang::driver::ToolChain::CST_Libstdcxx
@ CST_Libstdcxx
Definition: ToolChain.h:97
clang::driver::ToolChain::GetExceptionModel
virtual llvm::ExceptionHandling GetExceptionModel(const llvm::opt::ArgList &Args) const
GetExceptionModel - Return the tool chain exception model.
Definition: ToolChain.cpp:664
clang::driver::Driver::ResourceDir
std::string ResourceDir
The path to the compiler resource directory.
Definition: Driver.h:135
clang::driver::ToolChain::getArch
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:237
clang::driver::ToolChain::AddFilePathLibArgs
void AddFilePathLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option.
Definition: ToolChain.cpp:955
clang::driver::ToolChain::ShouldLinkCXXStdlib
bool ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const
Returns if the C++ standard library should be linked in.
Definition: ToolChain.cpp:932
clang::driver::Action::PrecompileJobClass
@ PrecompileJobClass
Definition: Action.h:60
clang::driver::Action::StaticLibJobClass
@ StaticLibJobClass
Definition: Action.h:76
clang::driver::ToolChain::getCompilerRTBasename
std::string getCompilerRTBasename(const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
Definition: ToolChain.cpp:422
clang::driver::options::NoXarchOption
@ NoXarchOption
Definition: Options.h:25
ToolChain.h
clang::driver::ToolChain::FT_Static
@ FT_Static
Definition: ToolChain.h:123
GetRTTIArgument
static llvm::opt::Arg * GetRTTIArgument(const ArgList &Args)
Definition: ToolChain.cpp:54
clang::driver::ToolChain::GetUnwindLibType
virtual UnwindLibType GetUnwindLibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:783
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::driver::ToolChain::getSupportedSanitizers
virtual SanitizerMask getSupportedSanitizers() const
Return sanitizers which are available in this toolchain.
Definition: ToolChain.cpp:998
clang::driver::ToolChain::getTool
virtual Tool * getTool(Action::ActionClass AC) const
Definition: ToolChain.cpp:329
clang::driver::Action::BackendJobClass
@ BackendJobClass
Definition: Action.h:65
clang::driver::ToolChain::addSystemIncludes
static void addSystemIncludes(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, ArrayRef< StringRef > Paths)
Utility function to add a list of system include directories to CC1.
Definition: ToolChain.cpp:875
clang::driver::ToolChain::AddCXXStdlibLibArgs
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:938
clang::driver::ToolChain::getArchSpecificLibPath
std::string getArchSpecificLibPath() const
Definition: ToolChain.cpp:502
clang::driver::ToolChain::RM_Enabled
@ RM_Enabled
Definition: ToolChain.h:112
clang::ObjCRuntime::GNUstep
@ GNUstep
'gnustep' is the modern non-fragile GNUstep runtime.
Definition: ObjCRuntime.h:56
clang::driver::ToolChain::GetRuntimeLibType
virtual RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:757
clang::driver::ToolChain::addProfileRTLibs
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:749
clang::driver::Action::AnalyzeJobClass
@ AnalyzeJobClass
Definition: Action.h:62
clang::driver::ToolChain::getCompilerRTArgString
const char * getCompilerRTArgString(const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
Definition: ToolChain.cpp:484
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:91
clang::driver::ToolChain::RLT_CompilerRT
@ RLT_CompilerRT
Definition: ToolChain.h:101
llvm::ArrayRef
Definition: LLVM.h:34
clang::driver::ToolChain::AddCudaIncludeArgs
virtual void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Add arguments to use system-specific CUDA includes.
Definition: ToolChain.cpp:1023
clang::driver::ToolChain::LookupTypeForExtension
virtual types::ID LookupTypeForExtension(StringRef Ext) const
LookupTypeForExtension - Return the default language type to use for the given extension.
Definition: ToolChain.cpp:626
clang::SanitizerKind
Definition: Sanitizers.h:131
clang::driver::ToolChain::useIntegratedAs
virtual bool useIntegratedAs() const
Check if the toolchain should use the integrated assembler.
Definition: ToolChain.cpp:103
clang::driver::ToolChain::AddClangCXXStdlibIsystemArgs
void AddClangCXXStdlibIsystemArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
AddClangCXXStdlibIsystemArgs - Add the clang -cc1 level arguments to set the specified include paths ...
Definition: ToolChain.cpp:921
clang::driver::ToolChain::computeSysRoot
virtual std::string computeSysRoot() const
Return the sysroot, possibly searching for a default sysroot using target-specific logic.
Definition: ToolChain.cpp:734
clang::driver::ToolChain::ComputeLLVMTriple
virtual std::string ComputeLLVMTriple(const llvm::opt::ArgList &Args, types::ID InputType=types::TY_INVALID) const
ComputeLLVMTriple - Return the LLVM target triple to use, after taking command line arguments into ac...
Definition: ToolChain.cpp:681
clang::driver::ToolChain::getLibraryPaths
path_list & getLibraryPaths()
Definition: ToolChain.h:256
clang::driver::ToolChain::isNoExecStackDefault
virtual bool isNoExecStackDefault() const
Test whether this toolchaind defaults to non-executable stacks.
Definition: ToolChain.cpp:113
clang::driver::Action::BindArchClass
@ BindArchClass
Definition: Action.h:57
clang::driver::types::ID
ID
Definition: Types.h:23
clang::driver::tools::OffloadBundler
Offload bundler tool.
Definition: Clang.h:138
clang::ObjCRuntime
The basic abstraction for the target Objective-C runtime.
Definition: ObjCRuntime.h:28
clang::driver::Action::CompileJobClass
@ CompileJobClass
Definition: Action.h:64
clang::driver::ToolChain::getOSLibName
virtual StringRef getOSLibName() const
Definition: ToolChain.cpp:392
clang::driver::ToolChain::FileType
FileType
Definition: ToolChain.h:123
clang::driver::Driver::GetFilePath
std::string GetFilePath(StringRef Name, const ToolChain &TC) const
GetFilePath - Lookup Name in the list of file search paths.
Definition: Driver.cpp:5119
clang::driver::ToolChain::GetDefaultCXXStdlibType
virtual CXXStdlibType GetDefaultCXXStdlibType() const
Definition: ToolChain.h:433
clang::driver::ToolChain::GetCXXStdlibType
virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:819
clang::driver::ToolChain::AddIAMCUIncludeArgs
virtual void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Add arguments to use MCU GCC toolchain includes.
Definition: ToolChain.cpp:1034
clang::driver::ToolChain::GetDefaultUnwindLibType
virtual UnwindLibType GetDefaultUnwindLibType() const
Definition: ToolChain.h:437
Sanitizers.h
clang::driver::InputInfo::getFilename
const char * getFilename() const
Definition: InputInfo.h:83
clang::driver::ToolChain::isThreadModelSupported
virtual bool isThreadModelSupported(const StringRef Model) const
isThreadModelSupported() - Does this target support a thread model?
Definition: ToolChain.cpp:668
clang::DiagnosticsEngine::getCustomDiagID
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
Definition: Diagnostic.h:866
clang
Definition: CalledOnceCheck.h:17
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
clang::driver::Action::MigrateJobClass
@ MigrateJobClass
Definition: Action.h:63
clang::driver::Action::OffloadWrapperJobClass
@ OffloadWrapperJobClass
Definition: Action.h:75
clang::driver::Action::HeaderModulePrecompileJobClass
@ HeaderModulePrecompileJobClass
Definition: Action.h:61
clang::driver::tools::ifstool::Merger
Definition: InterfaceStubs.h:19
clang::driver::ToolChain::UnwindLibType
UnwindLibType
Definition: ToolChain.h:105
clang::driver::ToolChain::AddHIPIncludeArgs
virtual void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Add arguments to use system-specific HIP includes.
Definition: ToolChain.cpp:1026
clang::driver::Action::VerifyDebugInfoJobClass
@ VerifyDebugInfoJobClass
Definition: Action.h:71
clang::driver::ToolChain::getStdlibPath
virtual std::string getStdlibPath() const
Definition: ToolChain.cpp:496
clang::driver::Driver::getVFS
llvm::vfs::FileSystem & getVFS() const
Definition: Driver.h:329
CalculateRTTIMode
static ToolChain::RTTIMode CalculateRTTIMode(const ArgList &Args, const llvm::Triple &Triple, const Arg *CachedRTTIArg)
Definition: ToolChain.cpp:59
clang::driver::ToolChain::addExternCSystemInclude
static void addExternCSystemInclude(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Utility function to add a system include directory with extern "C" semantics to CC1 arguments.
Definition: ToolChain.cpp:860
clang::driver::ToolChain::needsGCovInstrumentation
static bool needsGCovInstrumentation(const llvm::opt::ArgList &Args)
Returns true if gcov instrumentation (-fprofile-arcs or –coverage) is on.
Definition: ToolChain.cpp:523
clang::driver::ToolChain::addClangTargetOptions
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:743
clang::driver::ToolChain::isCrossCompiling
virtual bool isCrossCompiling() const
Returns true if the toolchain is targeting a non-native architecture.
Definition: ToolChain.cpp:642
clang::driver::ToolChain::RTTIMode
RTTIMode
Definition: ToolChain.h:111
ARM.h
clang::driver::ToolChain::getXRayArgs
const XRayArgs & getXRayArgs() const
Definition: ToolChain.cpp:123
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:85
clang::driver::ToolChain::useRelaxRelocations
virtual bool useRelaxRelocations() const
Check whether to enable x86 relax relocations by default.
Definition: ToolChain.cpp:109
Flang.h
clang::driver::ToolChain::~ToolChain
virtual ~ToolChain()
llvm::SmallVectorImpl
Definition: LLVM.h:39
clang::driver::ToolChain::addSystemInclude
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:845
AIX
clang::driver::toolchains::AIX AIX
Definition: AIX.cpp:18
clang::driver::ToolChain::FT_Shared
@ FT_Shared
Definition: ToolChain.h:123
clang::driver::JobAction
Definition: Action.h:380
clang::driver::Action::LinkJobClass
@ LinkJobClass
Definition: Action.h:67
clang::driver::Action::IfsMergeJobClass
@ IfsMergeJobClass
Definition: Action.h:68
clang::driver::ToolChain::GetDefaultRuntimeLibType
virtual RuntimeLibType GetDefaultRuntimeLibType() const
GetDefaultRuntimeLibType - Get the default runtime library variant to use.
Definition: ToolChain.h:429
clang::driver::ToolChain::buildAssembler
virtual Tool * buildAssembler() const
Definition: ToolChain.cpp:275
clang::SanitizerMask
Definition: Sanitizers.h:30
clang::driver::Action::InputClass
@ InputClass
Definition: Action.h:56
clang::driver::Driver::IsFlangMode
bool IsFlangMode() const
Whether the driver should invoke flang for fortran inputs.
Definition: Driver.h:192
clang::driver::ToolChain::GetStaticLibToolPath
std::string GetStaticLibToolPath() const
Returns the linker path for emitting a static library.
Definition: ToolChain.cpp:619
clang::driver::Action::VerifyPCHJobClass
@ VerifyPCHJobClass
Definition: Action.h:72
clang::driver::ToolChain::ComputeEffectiveClangTriple
virtual std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args, types::ID InputType=types::TY_INVALID) const
ComputeEffectiveClangTriple - Return the Clang triple to use for this target, which may take into acc...
Definition: ToolChain.cpp:729
clang::driver::ToolChain::RM_Disabled
@ RM_Disabled
Definition: ToolChain.h:113
clang::driver::ToolChain::getRuntimePath
virtual std::string getRuntimePath() const
Definition: ToolChain.cpp:490