LLVM  15.0.0git
Triple.cpp
Go to the documentation of this file.
1 //===--- Triple.cpp - Target triple helper class --------------------------===//
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 "llvm/ADT/Triple.h"
11 #include "llvm/ADT/SmallString.h"
12 #include "llvm/ADT/StringExtras.h"
13 #include "llvm/ADT/StringSwitch.h"
16 #include "llvm/Support/Host.h"
19 #include <cassert>
20 #include <cstring>
21 using namespace llvm;
22 
24  switch (Kind) {
25  case UnknownArch: return "unknown";
26 
27  case aarch64: return "aarch64";
28  case aarch64_32: return "aarch64_32";
29  case aarch64_be: return "aarch64_be";
30  case amdgcn: return "amdgcn";
31  case amdil64: return "amdil64";
32  case amdil: return "amdil";
33  case arc: return "arc";
34  case arm: return "arm";
35  case armeb: return "armeb";
36  case avr: return "avr";
37  case bpfeb: return "bpfeb";
38  case bpfel: return "bpfel";
39  case csky: return "csky";
40  case dxil: return "dxil";
41  case hexagon: return "hexagon";
42  case hsail64: return "hsail64";
43  case hsail: return "hsail";
44  case kalimba: return "kalimba";
45  case lanai: return "lanai";
46  case le32: return "le32";
47  case le64: return "le64";
48  case loongarch32: return "loongarch32";
49  case loongarch64: return "loongarch64";
50  case m68k: return "m68k";
51  case mips64: return "mips64";
52  case mips64el: return "mips64el";
53  case mips: return "mips";
54  case mipsel: return "mipsel";
55  case msp430: return "msp430";
56  case nvptx64: return "nvptx64";
57  case nvptx: return "nvptx";
58  case ppc64: return "powerpc64";
59  case ppc64le: return "powerpc64le";
60  case ppc: return "powerpc";
61  case ppcle: return "powerpcle";
62  case r600: return "r600";
63  case renderscript32: return "renderscript32";
64  case renderscript64: return "renderscript64";
65  case riscv32: return "riscv32";
66  case riscv64: return "riscv64";
67  case shave: return "shave";
68  case sparc: return "sparc";
69  case sparcel: return "sparcel";
70  case sparcv9: return "sparcv9";
71  case spir64: return "spir64";
72  case spir: return "spir";
73  case spirv32: return "spirv32";
74  case spirv64: return "spirv64";
75  case systemz: return "s390x";
76  case tce: return "tce";
77  case tcele: return "tcele";
78  case thumb: return "thumb";
79  case thumbeb: return "thumbeb";
80  case ve: return "ve";
81  case wasm32: return "wasm32";
82  case wasm64: return "wasm64";
83  case x86: return "i386";
84  case x86_64: return "x86_64";
85  case xcore: return "xcore";
86  }
87 
88  llvm_unreachable("Invalid ArchType!");
89 }
90 
92  switch (Kind) {
93  default:
94  return StringRef();
95 
96  case aarch64:
97  case aarch64_be:
98  case aarch64_32: return "aarch64";
99 
100  case arc: return "arc";
101 
102  case arm:
103  case armeb:
104  case thumb:
105  case thumbeb: return "arm";
106 
107  case avr: return "avr";
108 
109  case ppc64:
110  case ppc64le:
111  case ppc:
112  case ppcle: return "ppc";
113 
114  case m68k: return "m68k";
115 
116  case mips:
117  case mipsel:
118  case mips64:
119  case mips64el: return "mips";
120 
121  case hexagon: return "hexagon";
122 
123  case amdgcn: return "amdgcn";
124  case r600: return "r600";
125 
126  case bpfel:
127  case bpfeb: return "bpf";
128 
129  case sparcv9:
130  case sparcel:
131  case sparc: return "sparc";
132 
133  case systemz: return "s390";
134 
135  case x86:
136  case x86_64: return "x86";
137 
138  case xcore: return "xcore";
139 
140  // NVPTX intrinsics are namespaced under nvvm.
141  case nvptx: return "nvvm";
142  case nvptx64: return "nvvm";
143 
144  case le32: return "le32";
145  case le64: return "le64";
146 
147  case amdil:
148  case amdil64: return "amdil";
149 
150  case hsail:
151  case hsail64: return "hsail";
152 
153  case spir:
154  case spir64: return "spir";
155 
156  case spirv32:
157  case spirv64: return "spirv";
158 
159  case kalimba: return "kalimba";
160  case lanai: return "lanai";
161  case shave: return "shave";
162  case wasm32:
163  case wasm64: return "wasm";
164 
165  case riscv32:
166  case riscv64: return "riscv";
167 
168  case ve: return "ve";
169  case csky: return "csky";
170 
171  case loongarch32:
172  case loongarch64: return "loongarch";
173 
174  case dxil: return "dx";
175  }
176 }
177 
179  switch (Kind) {
180  case UnknownVendor: return "unknown";
181 
182  case AMD: return "amd";
183  case Apple: return "apple";
184  case CSR: return "csr";
185  case Freescale: return "fsl";
186  case IBM: return "ibm";
187  case ImaginationTechnologies: return "img";
188  case Mesa: return "mesa";
189  case MipsTechnologies: return "mti";
190  case Myriad: return "myriad";
191  case NVIDIA: return "nvidia";
192  case OpenEmbedded: return "oe";
193  case PC: return "pc";
194  case SCEI: return "scei";
195  case SUSE: return "suse";
196  }
197 
198  llvm_unreachable("Invalid VendorType!");
199 }
200 
202  switch (Kind) {
203  case UnknownOS: return "unknown";
204 
205  case AIX: return "aix";
206  case AMDHSA: return "amdhsa";
207  case AMDPAL: return "amdpal";
208  case Ananas: return "ananas";
209  case CUDA: return "cuda";
210  case CloudABI: return "cloudabi";
211  case Contiki: return "contiki";
212  case Darwin: return "darwin";
213  case DragonFly: return "dragonfly";
214  case DriverKit: return "driverkit";
215  case ELFIAMCU: return "elfiamcu";
216  case Emscripten: return "emscripten";
217  case FreeBSD: return "freebsd";
218  case Fuchsia: return "fuchsia";
219  case Haiku: return "haiku";
220  case HermitCore: return "hermit";
221  case Hurd: return "hurd";
222  case IOS: return "ios";
223  case KFreeBSD: return "kfreebsd";
224  case Linux: return "linux";
225  case Lv2: return "lv2";
226  case MacOSX: return "macosx";
227  case Mesa3D: return "mesa3d";
228  case Minix: return "minix";
229  case NVCL: return "nvcl";
230  case NaCl: return "nacl";
231  case NetBSD: return "netbsd";
232  case OpenBSD: return "openbsd";
233  case PS4: return "ps4";
234  case PS5: return "ps5";
235  case RTEMS: return "rtems";
236  case Solaris: return "solaris";
237  case TvOS: return "tvos";
238  case WASI: return "wasi";
239  case WatchOS: return "watchos";
240  case Win32: return "windows";
241  case ZOS: return "zos";
242  case ShaderModel: return "shadermodel";
243  }
244 
245  llvm_unreachable("Invalid OSType");
246 }
247 
249  switch (Kind) {
250  case UnknownEnvironment: return "unknown";
251  case Android: return "android";
252  case CODE16: return "code16";
253  case CoreCLR: return "coreclr";
254  case Cygnus: return "cygnus";
255  case EABI: return "eabi";
256  case EABIHF: return "eabihf";
257  case GNU: return "gnu";
258  case GNUABI64: return "gnuabi64";
259  case GNUABIN32: return "gnuabin32";
260  case GNUEABI: return "gnueabi";
261  case GNUEABIHF: return "gnueabihf";
262  case GNUX32: return "gnux32";
263  case GNUILP32: return "gnu_ilp32";
264  case Itanium: return "itanium";
265  case MSVC: return "msvc";
266  case MacABI: return "macabi";
267  case Musl: return "musl";
268  case MuslEABI: return "musleabi";
269  case MuslEABIHF: return "musleabihf";
270  case MuslX32: return "muslx32";
271  case Simulator: return "simulator";
272  case Pixel: return "pixel";
273  case Vertex: return "vertex";
274  case Geometry: return "geometry";
275  case Hull: return "hull";
276  case Domain: return "domain";
277  case Compute: return "compute";
278  case Library: return "library";
279  case RayGeneration: return "raygeneration";
280  case Intersection: return "intersection";
281  case AnyHit: return "anyhit";
282  case ClosestHit: return "closesthit";
283  case Miss: return "miss";
284  case Callable: return "callable";
285  case Mesh: return "mesh";
286  case Amplification: return "amplification";
287  }
288 
289  llvm_unreachable("Invalid EnvironmentType!");
290 }
291 
293  if (ArchName.equals("bpf")) {
295  return Triple::bpfel;
296  else
297  return Triple::bpfeb;
298  } else if (ArchName.equals("bpf_be") || ArchName.equals("bpfeb")) {
299  return Triple::bpfeb;
300  } else if (ArchName.equals("bpf_le") || ArchName.equals("bpfel")) {
301  return Triple::bpfel;
302  } else {
303  return Triple::UnknownArch;
304  }
305 }
306 
310  .Case("aarch64", aarch64)
311  .Case("aarch64_be", aarch64_be)
312  .Case("aarch64_32", aarch64_32)
313  .Case("arc", arc)
314  .Case("arm64", aarch64) // "arm64" is an alias for "aarch64"
315  .Case("arm64_32", aarch64_32)
316  .Case("arm", arm)
317  .Case("armeb", armeb)
318  .Case("avr", avr)
319  .StartsWith("bpf", BPFArch)
320  .Case("m68k", m68k)
321  .Case("mips", mips)
322  .Case("mipsel", mipsel)
323  .Case("mips64", mips64)
324  .Case("mips64el", mips64el)
325  .Case("msp430", msp430)
326  .Case("ppc64", ppc64)
327  .Case("ppc32", ppc)
328  .Case("ppc", ppc)
329  .Case("ppc32le", ppcle)
330  .Case("ppcle", ppcle)
331  .Case("ppc64le", ppc64le)
332  .Case("r600", r600)
333  .Case("amdgcn", amdgcn)
334  .Case("riscv32", riscv32)
335  .Case("riscv64", riscv64)
336  .Case("hexagon", hexagon)
337  .Case("sparc", sparc)
338  .Case("sparcel", sparcel)
339  .Case("sparcv9", sparcv9)
340  .Case("s390x", systemz)
341  .Case("systemz", systemz)
342  .Case("tce", tce)
343  .Case("tcele", tcele)
344  .Case("thumb", thumb)
345  .Case("thumbeb", thumbeb)
346  .Case("x86", x86)
347  .Case("i386", x86)
348  .Case("x86-64", x86_64)
349  .Case("xcore", xcore)
350  .Case("nvptx", nvptx)
351  .Case("nvptx64", nvptx64)
352  .Case("le32", le32)
353  .Case("le64", le64)
354  .Case("amdil", amdil)
355  .Case("amdil64", amdil64)
356  .Case("hsail", hsail)
357  .Case("hsail64", hsail64)
358  .Case("spir", spir)
359  .Case("spir64", spir64)
360  .Case("spirv32", spirv32)
361  .Case("spirv64", spirv64)
362  .Case("kalimba", kalimba)
363  .Case("lanai", lanai)
364  .Case("shave", shave)
365  .Case("wasm32", wasm32)
366  .Case("wasm64", wasm64)
367  .Case("renderscript32", renderscript32)
368  .Case("renderscript64", renderscript64)
369  .Case("ve", ve)
370  .Case("csky", csky)
371  .Case("loongarch32", loongarch32)
372  .Case("loongarch64", loongarch64)
373  .Case("dxil", dxil)
375 }
376 
378  ARM::ISAKind ISA = ARM::parseArchISA(ArchName);
379  ARM::EndianKind ENDIAN = ARM::parseArchEndian(ArchName);
380 
382  switch (ENDIAN) {
384  switch (ISA) {
385  case ARM::ISAKind::ARM:
386  arch = Triple::arm;
387  break;
388  case ARM::ISAKind::THUMB:
389  arch = Triple::thumb;
390  break;
392  arch = Triple::aarch64;
393  break;
395  break;
396  }
397  break;
398  }
399  case ARM::EndianKind::BIG: {
400  switch (ISA) {
401  case ARM::ISAKind::ARM:
402  arch = Triple::armeb;
403  break;
404  case ARM::ISAKind::THUMB:
405  arch = Triple::thumbeb;
406  break;
408  arch = Triple::aarch64_be;
409  break;
411  break;
412  }
413  break;
414  }
416  break;
417  }
418  }
419 
420  ArchName = ARM::getCanonicalArchName(ArchName);
421  if (ArchName.empty())
422  return Triple::UnknownArch;
423 
424  // Thumb only exists in v4+
425  if (ISA == ARM::ISAKind::THUMB &&
426  (ArchName.startswith("v2") || ArchName.startswith("v3")))
427  return Triple::UnknownArch;
428 
429  // Thumb only for v6m
431  unsigned Version = ARM::parseArchVersion(ArchName);
432  if (Profile == ARM::ProfileKind::M && Version == 6) {
433  if (ENDIAN == ARM::EndianKind::BIG)
434  return Triple::thumbeb;
435  else
436  return Triple::thumb;
437  }
438 
439  return arch;
440 }
441 
443  auto AT = StringSwitch<Triple::ArchType>(ArchName)
444  .Cases("i386", "i486", "i586", "i686", Triple::x86)
445  // FIXME: Do we need to support these?
446  .Cases("i786", "i886", "i986", Triple::x86)
447  .Cases("amd64", "x86_64", "x86_64h", Triple::x86_64)
448  .Cases("powerpc", "powerpcspe", "ppc", "ppc32", Triple::ppc)
449  .Cases("powerpcle", "ppcle", "ppc32le", Triple::ppcle)
450  .Cases("powerpc64", "ppu", "ppc64", Triple::ppc64)
451  .Cases("powerpc64le", "ppc64le", Triple::ppc64le)
452  .Case("xscale", Triple::arm)
453  .Case("xscaleeb", Triple::armeb)
454  .Case("aarch64", Triple::aarch64)
455  .Case("aarch64_be", Triple::aarch64_be)
456  .Case("aarch64_32", Triple::aarch64_32)
457  .Case("arc", Triple::arc)
458  .Case("arm64", Triple::aarch64)
459  .Case("arm64_32", Triple::aarch64_32)
460  .Case("arm64e", Triple::aarch64)
461  .Case("arm", Triple::arm)
462  .Case("armeb", Triple::armeb)
463  .Case("thumb", Triple::thumb)
464  .Case("thumbeb", Triple::thumbeb)
465  .Case("avr", Triple::avr)
466  .Case("m68k", Triple::m68k)
467  .Case("msp430", Triple::msp430)
468  .Cases("mips", "mipseb", "mipsallegrex", "mipsisa32r6",
469  "mipsr6", Triple::mips)
470  .Cases("mipsel", "mipsallegrexel", "mipsisa32r6el", "mipsr6el",
472  .Cases("mips64", "mips64eb", "mipsn32", "mipsisa64r6",
473  "mips64r6", "mipsn32r6", Triple::mips64)
474  .Cases("mips64el", "mipsn32el", "mipsisa64r6el", "mips64r6el",
475  "mipsn32r6el", Triple::mips64el)
476  .Case("r600", Triple::r600)
477  .Case("amdgcn", Triple::amdgcn)
478  .Case("riscv32", Triple::riscv32)
479  .Case("riscv64", Triple::riscv64)
480  .Case("hexagon", Triple::hexagon)
481  .Cases("s390x", "systemz", Triple::systemz)
482  .Case("sparc", Triple::sparc)
483  .Case("sparcel", Triple::sparcel)
484  .Cases("sparcv9", "sparc64", Triple::sparcv9)
485  .Case("tce", Triple::tce)
486  .Case("tcele", Triple::tcele)
487  .Case("xcore", Triple::xcore)
488  .Case("nvptx", Triple::nvptx)
489  .Case("nvptx64", Triple::nvptx64)
490  .Case("le32", Triple::le32)
491  .Case("le64", Triple::le64)
492  .Case("amdil", Triple::amdil)
493  .Case("amdil64", Triple::amdil64)
494  .Case("hsail", Triple::hsail)
495  .Case("hsail64", Triple::hsail64)
496  .Case("spir", Triple::spir)
497  .Case("spir64", Triple::spir64)
498  .Case("spirv32", Triple::spirv32)
499  .Case("spirv64", Triple::spirv64)
500  .StartsWith("kalimba", Triple::kalimba)
501  .Case("lanai", Triple::lanai)
502  .Case("renderscript32", Triple::renderscript32)
503  .Case("renderscript64", Triple::renderscript64)
504  .Case("shave", Triple::shave)
505  .Case("ve", Triple::ve)
506  .Case("wasm32", Triple::wasm32)
507  .Case("wasm64", Triple::wasm64)
508  .Case("csky", Triple::csky)
509  .Case("loongarch32", Triple::loongarch32)
510  .Case("loongarch64", Triple::loongarch64)
511  .Case("dxil", Triple::dxil)
513 
514  // Some architectures require special parsing logic just to compute the
515  // ArchType result.
516  if (AT == Triple::UnknownArch) {
517  if (ArchName.startswith("arm") || ArchName.startswith("thumb") ||
518  ArchName.startswith("aarch64"))
519  return parseARMArch(ArchName);
520  if (ArchName.startswith("bpf"))
521  return parseBPFArch(ArchName);
522  }
523 
524  return AT;
525 }
526 
528  return StringSwitch<Triple::VendorType>(VendorName)
529  .Case("apple", Triple::Apple)
530  .Case("pc", Triple::PC)
531  .Case("scei", Triple::SCEI)
532  .Case("sie", Triple::SCEI)
533  .Case("fsl", Triple::Freescale)
534  .Case("ibm", Triple::IBM)
537  .Case("nvidia", Triple::NVIDIA)
538  .Case("csr", Triple::CSR)
539  .Case("myriad", Triple::Myriad)
540  .Case("amd", Triple::AMD)
541  .Case("mesa", Triple::Mesa)
542  .Case("suse", Triple::SUSE)
543  .Case("oe", Triple::OpenEmbedded)
545 }
546 
548  return StringSwitch<Triple::OSType>(OSName)
549  .StartsWith("ananas", Triple::Ananas)
550  .StartsWith("cloudabi", Triple::CloudABI)
551  .StartsWith("darwin", Triple::Darwin)
552  .StartsWith("dragonfly", Triple::DragonFly)
553  .StartsWith("freebsd", Triple::FreeBSD)
554  .StartsWith("fuchsia", Triple::Fuchsia)
555  .StartsWith("ios", Triple::IOS)
556  .StartsWith("kfreebsd", Triple::KFreeBSD)
557  .StartsWith("linux", Triple::Linux)
558  .StartsWith("lv2", Triple::Lv2)
559  .StartsWith("macos", Triple::MacOSX)
560  .StartsWith("netbsd", Triple::NetBSD)
561  .StartsWith("openbsd", Triple::OpenBSD)
562  .StartsWith("solaris", Triple::Solaris)
563  .StartsWith("win32", Triple::Win32)
564  .StartsWith("windows", Triple::Win32)
565  .StartsWith("zos", Triple::ZOS)
566  .StartsWith("haiku", Triple::Haiku)
567  .StartsWith("minix", Triple::Minix)
568  .StartsWith("rtems", Triple::RTEMS)
569  .StartsWith("nacl", Triple::NaCl)
570  .StartsWith("aix", Triple::AIX)
571  .StartsWith("cuda", Triple::CUDA)
572  .StartsWith("nvcl", Triple::NVCL)
573  .StartsWith("amdhsa", Triple::AMDHSA)
574  .StartsWith("ps4", Triple::PS4)
575  .StartsWith("ps5", Triple::PS5)
576  .StartsWith("elfiamcu", Triple::ELFIAMCU)
577  .StartsWith("tvos", Triple::TvOS)
578  .StartsWith("watchos", Triple::WatchOS)
579  .StartsWith("driverkit", Triple::DriverKit)
580  .StartsWith("mesa3d", Triple::Mesa3D)
581  .StartsWith("contiki", Triple::Contiki)
582  .StartsWith("amdpal", Triple::AMDPAL)
583  .StartsWith("hermit", Triple::HermitCore)
584  .StartsWith("hurd", Triple::Hurd)
585  .StartsWith("wasi", Triple::WASI)
586  .StartsWith("emscripten", Triple::Emscripten)
587  .StartsWith("shadermodel", Triple::ShaderModel)
589 }
590 
592  return StringSwitch<Triple::EnvironmentType>(EnvironmentName)
593  .StartsWith("eabihf", Triple::EABIHF)
594  .StartsWith("eabi", Triple::EABI)
595  .StartsWith("gnuabin32", Triple::GNUABIN32)
596  .StartsWith("gnuabi64", Triple::GNUABI64)
597  .StartsWith("gnueabihf", Triple::GNUEABIHF)
598  .StartsWith("gnueabi", Triple::GNUEABI)
599  .StartsWith("gnux32", Triple::GNUX32)
600  .StartsWith("gnu_ilp32", Triple::GNUILP32)
601  .StartsWith("code16", Triple::CODE16)
602  .StartsWith("gnu", Triple::GNU)
603  .StartsWith("android", Triple::Android)
604  .StartsWith("musleabihf", Triple::MuslEABIHF)
605  .StartsWith("musleabi", Triple::MuslEABI)
606  .StartsWith("muslx32", Triple::MuslX32)
607  .StartsWith("musl", Triple::Musl)
608  .StartsWith("msvc", Triple::MSVC)
609  .StartsWith("itanium", Triple::Itanium)
610  .StartsWith("cygnus", Triple::Cygnus)
611  .StartsWith("coreclr", Triple::CoreCLR)
612  .StartsWith("simulator", Triple::Simulator)
613  .StartsWith("macabi", Triple::MacABI)
614  .StartsWith("pixel", Triple::Pixel)
615  .StartsWith("vertex", Triple::Vertex)
616  .StartsWith("geometry", Triple::Geometry)
617  .StartsWith("hull", Triple::Hull)
618  .StartsWith("domain", Triple::Domain)
619  .StartsWith("compute", Triple::Compute)
620  .StartsWith("library", Triple::Library)
621  .StartsWith("raygeneration", Triple::RayGeneration)
622  .StartsWith("intersection", Triple::Intersection)
623  .StartsWith("anyhit", Triple::AnyHit)
624  .StartsWith("closesthit", Triple::ClosestHit)
625  .StartsWith("miss", Triple::Miss)
626  .StartsWith("callable", Triple::Callable)
627  .StartsWith("mesh", Triple::Mesh)
628  .StartsWith("amplification", Triple::Amplification)
630 }
631 
633  return StringSwitch<Triple::ObjectFormatType>(EnvironmentName)
634  // "xcoff" must come before "coff" because of the order-dependendent
635  // pattern matching.
636  .EndsWith("xcoff", Triple::XCOFF)
637  .EndsWith("coff", Triple::COFF)
638  .EndsWith("elf", Triple::ELF)
639  .EndsWith("goff", Triple::GOFF)
640  .EndsWith("macho", Triple::MachO)
641  .EndsWith("wasm", Triple::Wasm)
642  .EndsWith("spirv", Triple::SPIRV)
644 }
645 
647  if (SubArchName.startswith("mips") &&
648  (SubArchName.endswith("r6el") || SubArchName.endswith("r6")))
649  return Triple::MipsSubArch_r6;
650 
651  if (SubArchName == "powerpcspe")
652  return Triple::PPCSubArch_spe;
653 
654  if (SubArchName == "arm64e")
656 
657  StringRef ARMSubArch = ARM::getCanonicalArchName(SubArchName);
658 
659  // For now, this is the small part. Early return.
660  if (ARMSubArch.empty())
661  return StringSwitch<Triple::SubArchType>(SubArchName)
662  .EndsWith("kalimba3", Triple::KalimbaSubArch_v3)
663  .EndsWith("kalimba4", Triple::KalimbaSubArch_v4)
664  .EndsWith("kalimba5", Triple::KalimbaSubArch_v5)
666 
667  // ARM sub arch.
668  switch(ARM::parseArch(ARMSubArch)) {
669  case ARM::ArchKind::ARMV4:
670  return Triple::NoSubArch;
671  case ARM::ArchKind::ARMV4T:
672  return Triple::ARMSubArch_v4t;
673  case ARM::ArchKind::ARMV5T:
674  return Triple::ARMSubArch_v5;
675  case ARM::ArchKind::ARMV5TE:
676  case ARM::ArchKind::IWMMXT:
677  case ARM::ArchKind::IWMMXT2:
678  case ARM::ArchKind::XSCALE:
679  case ARM::ArchKind::ARMV5TEJ:
681  case ARM::ArchKind::ARMV6:
682  return Triple::ARMSubArch_v6;
683  case ARM::ArchKind::ARMV6K:
684  case ARM::ArchKind::ARMV6KZ:
685  return Triple::ARMSubArch_v6k;
686  case ARM::ArchKind::ARMV6T2:
688  case ARM::ArchKind::ARMV6M:
689  return Triple::ARMSubArch_v6m;
690  case ARM::ArchKind::ARMV7A:
691  case ARM::ArchKind::ARMV7R:
692  return Triple::ARMSubArch_v7;
693  case ARM::ArchKind::ARMV7VE:
695  case ARM::ArchKind::ARMV7K:
696  return Triple::ARMSubArch_v7k;
697  case ARM::ArchKind::ARMV7M:
698  return Triple::ARMSubArch_v7m;
699  case ARM::ArchKind::ARMV7S:
700  return Triple::ARMSubArch_v7s;
701  case ARM::ArchKind::ARMV7EM:
703  case ARM::ArchKind::ARMV8A:
704  return Triple::ARMSubArch_v8;
705  case ARM::ArchKind::ARMV8_1A:
707  case ARM::ArchKind::ARMV8_2A:
709  case ARM::ArchKind::ARMV8_3A:
711  case ARM::ArchKind::ARMV8_4A:
713  case ARM::ArchKind::ARMV8_5A:
715  case ARM::ArchKind::ARMV8_6A:
717  case ARM::ArchKind::ARMV8_7A:
719  case ARM::ArchKind::ARMV8_8A:
721  case ARM::ArchKind::ARMV9A:
722  return Triple::ARMSubArch_v9;
723  case ARM::ArchKind::ARMV9_1A:
725  case ARM::ArchKind::ARMV9_2A:
727  case ARM::ArchKind::ARMV9_3A:
729  case ARM::ArchKind::ARMV8R:
730  return Triple::ARMSubArch_v8r;
731  case ARM::ArchKind::ARMV8MBaseline:
733  case ARM::ArchKind::ARMV8MMainline:
735  case ARM::ArchKind::ARMV8_1MMainline:
737  default:
738  return Triple::NoSubArch;
739  }
740 }
741 
743  switch (Kind) {
745  return "";
746  case Triple::COFF:
747  return "coff";
748  case Triple::ELF:
749  return "elf";
750  case Triple::GOFF:
751  return "goff";
752  case Triple::MachO:
753  return "macho";
754  case Triple::Wasm:
755  return "wasm";
756  case Triple::XCOFF:
757  return "xcoff";
758  case Triple::DXContainer:
759  return "dxcontainer";
760  case Triple::SPIRV:
761  return "spirv";
762  }
763  llvm_unreachable("unknown object format type");
764 }
765 
767  switch (T.getArch()) {
768  case Triple::UnknownArch:
769  case Triple::aarch64:
770  case Triple::aarch64_32:
771  case Triple::arm:
772  case Triple::thumb:
773  case Triple::x86:
774  case Triple::x86_64:
775  if (T.isOSDarwin())
776  return Triple::MachO;
777  else if (T.isOSWindows())
778  return Triple::COFF;
779  return Triple::ELF;
780 
781  case Triple::aarch64_be:
782  case Triple::amdgcn:
783  case Triple::amdil64:
784  case Triple::amdil:
785  case Triple::arc:
786  case Triple::armeb:
787  case Triple::avr:
788  case Triple::bpfeb:
789  case Triple::bpfel:
790  case Triple::csky:
791  case Triple::hexagon:
792  case Triple::hsail64:
793  case Triple::hsail:
794  case Triple::kalimba:
795  case Triple::lanai:
796  case Triple::le32:
797  case Triple::le64:
798  case Triple::loongarch32:
799  case Triple::loongarch64:
800  case Triple::m68k:
801  case Triple::mips64:
802  case Triple::mips64el:
803  case Triple::mips:
804  case Triple::mipsel:
805  case Triple::msp430:
806  case Triple::nvptx64:
807  case Triple::nvptx:
808  case Triple::ppc64le:
809  case Triple::ppcle:
810  case Triple::r600:
813  case Triple::riscv32:
814  case Triple::riscv64:
815  case Triple::shave:
816  case Triple::sparc:
817  case Triple::sparcel:
818  case Triple::sparcv9:
819  case Triple::spir64:
820  case Triple::spir:
821  case Triple::tce:
822  case Triple::tcele:
823  case Triple::thumbeb:
824  case Triple::ve:
825  case Triple::xcore:
826  return Triple::ELF;
827 
828  case Triple::ppc64:
829  case Triple::ppc:
830  if (T.isOSAIX())
831  return Triple::XCOFF;
832  return Triple::ELF;
833 
834  case Triple::systemz:
835  if (T.isOSzOS())
836  return Triple::GOFF;
837  return Triple::ELF;
838 
839  case Triple::wasm32:
840  case Triple::wasm64:
841  return Triple::Wasm;
842 
843  case Triple::spirv32:
844  case Triple::spirv64:
845  return Triple::SPIRV;
846 
847  case Triple::dxil:
848  return Triple::DXContainer;
849  }
850  llvm_unreachable("unknown architecture");
851 }
852 
853 /// Construct a triple from the string representation provided.
854 ///
855 /// This stores the string representation and parses the various pieces into
856 /// enum members.
858  : Data(Str.str()), Arch(UnknownArch), SubArch(NoSubArch),
859  Vendor(UnknownVendor), OS(UnknownOS), Environment(UnknownEnvironment),
860  ObjectFormat(UnknownObjectFormat) {
861  // Do minimal parsing by hand here.
862  SmallVector<StringRef, 4> Components;
863  StringRef(Data).split(Components, '-', /*MaxSplit*/ 3);
864  if (Components.size() > 0) {
865  Arch = parseArch(Components[0]);
866  SubArch = parseSubArch(Components[0]);
867  if (Components.size() > 1) {
868  Vendor = parseVendor(Components[1]);
869  if (Components.size() > 2) {
870  OS = parseOS(Components[2]);
871  if (Components.size() > 3) {
872  Environment = parseEnvironment(Components[3]);
873  ObjectFormat = parseFormat(Components[3]);
874  }
875  }
876  } else {
877  Environment =
879  .StartsWith("mipsn32", Triple::GNUABIN32)
880  .StartsWith("mips64", Triple::GNUABI64)
881  .StartsWith("mipsisa64", Triple::GNUABI64)
882  .StartsWith("mipsisa32", Triple::GNU)
883  .Cases("mips", "mipsel", "mipsr6", "mipsr6el", Triple::GNU)
885  }
886  }
887  if (ObjectFormat == UnknownObjectFormat)
888  ObjectFormat = getDefaultFormat(*this);
889 }
890 
891 /// Construct a triple from string representations of the architecture,
892 /// vendor, and OS.
893 ///
894 /// This joins each argument into a canonical string representation and parses
895 /// them into enum members. It leaves the environment unknown and omits it from
896 /// the string representation.
897 Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr)
898  : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr).str()),
899  Arch(parseArch(ArchStr.str())),
900  SubArch(parseSubArch(ArchStr.str())),
901  Vendor(parseVendor(VendorStr.str())),
902  OS(parseOS(OSStr.str())),
903  Environment(), ObjectFormat(Triple::UnknownObjectFormat) {
904  ObjectFormat = getDefaultFormat(*this);
905 }
906 
907 /// Construct a triple from string representations of the architecture,
908 /// vendor, OS, and environment.
909 ///
910 /// This joins each argument into a canonical string representation and parses
911 /// them into enum members.
912 Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
913  const Twine &EnvironmentStr)
914  : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr + Twine('-') +
915  EnvironmentStr).str()),
916  Arch(parseArch(ArchStr.str())),
917  SubArch(parseSubArch(ArchStr.str())),
918  Vendor(parseVendor(VendorStr.str())),
919  OS(parseOS(OSStr.str())),
920  Environment(parseEnvironment(EnvironmentStr.str())),
921  ObjectFormat(parseFormat(EnvironmentStr.str())) {
922  if (ObjectFormat == Triple::UnknownObjectFormat)
923  ObjectFormat = getDefaultFormat(*this);
924 }
925 
926 std::string Triple::normalize(StringRef Str) {
927  bool IsMinGW32 = false;
928  bool IsCygwin = false;
929 
930  // Parse into components.
931  SmallVector<StringRef, 4> Components;
932  Str.split(Components, '-');
933 
934  // If the first component corresponds to a known architecture, preferentially
935  // use it for the architecture. If the second component corresponds to a
936  // known vendor, preferentially use it for the vendor, etc. This avoids silly
937  // component movement when a component parses as (eg) both a valid arch and a
938  // valid os.
939  ArchType Arch = UnknownArch;
940  if (Components.size() > 0)
941  Arch = parseArch(Components[0]);
942  VendorType Vendor = UnknownVendor;
943  if (Components.size() > 1)
944  Vendor = parseVendor(Components[1]);
945  OSType OS = UnknownOS;
946  if (Components.size() > 2) {
947  OS = parseOS(Components[2]);
948  IsCygwin = Components[2].startswith("cygwin");
949  IsMinGW32 = Components[2].startswith("mingw");
950  }
951  EnvironmentType Environment = UnknownEnvironment;
952  if (Components.size() > 3)
953  Environment = parseEnvironment(Components[3]);
954  ObjectFormatType ObjectFormat = UnknownObjectFormat;
955  if (Components.size() > 4)
956  ObjectFormat = parseFormat(Components[4]);
957 
958  // Note which components are already in their final position. These will not
959  // be moved.
960  bool Found[4];
961  Found[0] = Arch != UnknownArch;
962  Found[1] = Vendor != UnknownVendor;
963  Found[2] = OS != UnknownOS;
964  Found[3] = Environment != UnknownEnvironment;
965 
966  // If they are not there already, permute the components into their canonical
967  // positions by seeing if they parse as a valid architecture, and if so moving
968  // the component to the architecture position etc.
969  for (unsigned Pos = 0; Pos != array_lengthof(Found); ++Pos) {
970  if (Found[Pos])
971  continue; // Already in the canonical position.
972 
973  for (unsigned Idx = 0; Idx != Components.size(); ++Idx) {
974  // Do not reparse any components that already matched.
975  if (Idx < array_lengthof(Found) && Found[Idx])
976  continue;
977 
978  // Does this component parse as valid for the target position?
979  bool Valid = false;
980  StringRef Comp = Components[Idx];
981  switch (Pos) {
982  default: llvm_unreachable("unexpected component type!");
983  case 0:
984  Arch = parseArch(Comp);
985  Valid = Arch != UnknownArch;
986  break;
987  case 1:
988  Vendor = parseVendor(Comp);
989  Valid = Vendor != UnknownVendor;
990  break;
991  case 2:
992  OS = parseOS(Comp);
993  IsCygwin = Comp.startswith("cygwin");
994  IsMinGW32 = Comp.startswith("mingw");
995  Valid = OS != UnknownOS || IsCygwin || IsMinGW32;
996  break;
997  case 3:
998  Environment = parseEnvironment(Comp);
999  Valid = Environment != UnknownEnvironment;
1000  if (!Valid) {
1001  ObjectFormat = parseFormat(Comp);
1002  Valid = ObjectFormat != UnknownObjectFormat;
1003  }
1004  break;
1005  }
1006  if (!Valid)
1007  continue; // Nope, try the next component.
1008 
1009  // Move the component to the target position, pushing any non-fixed
1010  // components that are in the way to the right. This tends to give
1011  // good results in the common cases of a forgotten vendor component
1012  // or a wrongly positioned environment.
1013  if (Pos < Idx) {
1014  // Insert left, pushing the existing components to the right. For
1015  // example, a-b-i386 -> i386-a-b when moving i386 to the front.
1016  StringRef CurrentComponent(""); // The empty component.
1017  // Replace the component we are moving with an empty component.
1018  std::swap(CurrentComponent, Components[Idx]);
1019  // Insert the component being moved at Pos, displacing any existing
1020  // components to the right.
1021  for (unsigned i = Pos; !CurrentComponent.empty(); ++i) {
1022  // Skip over any fixed components.
1023  while (i < array_lengthof(Found) && Found[i])
1024  ++i;
1025  // Place the component at the new position, getting the component
1026  // that was at this position - it will be moved right.
1027  std::swap(CurrentComponent, Components[i]);
1028  }
1029  } else if (Pos > Idx) {
1030  // Push right by inserting empty components until the component at Idx
1031  // reaches the target position Pos. For example, pc-a -> -pc-a when
1032  // moving pc to the second position.
1033  do {
1034  // Insert one empty component at Idx.
1035  StringRef CurrentComponent(""); // The empty component.
1036  for (unsigned i = Idx; i < Components.size();) {
1037  // Place the component at the new position, getting the component
1038  // that was at this position - it will be moved right.
1039  std::swap(CurrentComponent, Components[i]);
1040  // If it was placed on top of an empty component then we are done.
1041  if (CurrentComponent.empty())
1042  break;
1043  // Advance to the next component, skipping any fixed components.
1044  while (++i < array_lengthof(Found) && Found[i])
1045  ;
1046  }
1047  // The last component was pushed off the end - append it.
1048  if (!CurrentComponent.empty())
1049  Components.push_back(CurrentComponent);
1050 
1051  // Advance Idx to the component's new position.
1052  while (++Idx < array_lengthof(Found) && Found[Idx])
1053  ;
1054  } while (Idx < Pos); // Add more until the final position is reached.
1055  }
1056  assert(Pos < Components.size() && Components[Pos] == Comp &&
1057  "Component moved wrong!");
1058  Found[Pos] = true;
1059  break;
1060  }
1061  }
1062 
1063  // Replace empty components with "unknown" value.
1064  for (StringRef &C : Components)
1065  if (C.empty())
1066  C = "unknown";
1067 
1068  // Special case logic goes here. At this point Arch, Vendor and OS have the
1069  // correct values for the computed components.
1070  std::string NormalizedEnvironment;
1071  if (Environment == Triple::Android && Components[3].startswith("androideabi")) {
1072  StringRef AndroidVersion = Components[3].drop_front(strlen("androideabi"));
1073  if (AndroidVersion.empty()) {
1074  Components[3] = "android";
1075  } else {
1076  NormalizedEnvironment = Twine("android", AndroidVersion).str();
1077  Components[3] = NormalizedEnvironment;
1078  }
1079  }
1080 
1081  // SUSE uses "gnueabi" to mean "gnueabihf"
1082  if (Vendor == Triple::SUSE && Environment == llvm::Triple::GNUEABI)
1083  Components[3] = "gnueabihf";
1084 
1085  if (OS == Triple::Win32) {
1086  Components.resize(4);
1087  Components[2] = "windows";
1088  if (Environment == UnknownEnvironment) {
1089  if (ObjectFormat == UnknownObjectFormat || ObjectFormat == Triple::COFF)
1090  Components[3] = "msvc";
1091  else
1092  Components[3] = getObjectFormatTypeName(ObjectFormat);
1093  }
1094  } else if (IsMinGW32) {
1095  Components.resize(4);
1096  Components[2] = "windows";
1097  Components[3] = "gnu";
1098  } else if (IsCygwin) {
1099  Components.resize(4);
1100  Components[2] = "windows";
1101  Components[3] = "cygnus";
1102  }
1103  if (IsMinGW32 || IsCygwin ||
1104  (OS == Triple::Win32 && Environment != UnknownEnvironment)) {
1105  if (ObjectFormat != UnknownObjectFormat && ObjectFormat != Triple::COFF) {
1106  Components.resize(5);
1107  Components[4] = getObjectFormatTypeName(ObjectFormat);
1108  }
1109  }
1110 
1111  // Stick the corrected components back together to form the normalized string.
1112  return join(Components, "-");
1113 }
1114 
1116  return StringRef(Data).split('-').first; // Isolate first component
1117 }
1118 
1120  switch (Kind) {
1121  case Triple::mips:
1122  if (SubArch == MipsSubArch_r6)
1123  return "mipsisa32r6";
1124  break;
1125  case Triple::mipsel:
1126  if (SubArch == MipsSubArch_r6)
1127  return "mipsisa32r6el";
1128  break;
1129  case Triple::mips64:
1130  if (SubArch == MipsSubArch_r6)
1131  return "mipsisa64r6";
1132  break;
1133  case Triple::mips64el:
1134  if (SubArch == MipsSubArch_r6)
1135  return "mipsisa64r6el";
1136  break;
1137  default:
1138  break;
1139  }
1140  return getArchTypeName(Kind);
1141 }
1142 
1144  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
1145  return Tmp.split('-').first; // Isolate second component
1146 }
1147 
1149  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
1150  Tmp = Tmp.split('-').second; // Strip second component
1151  return Tmp.split('-').first; // Isolate third component
1152 }
1153 
1155  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
1156  Tmp = Tmp.split('-').second; // Strip second component
1157  return Tmp.split('-').second; // Strip third component
1158 }
1159 
1161  StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
1162  return Tmp.split('-').second; // Strip second component
1163 }
1164 
1167  Version.tryParse(Name);
1168  return Version.withoutBuild();
1169 }
1170 
1172  StringRef EnvironmentName = getEnvironmentName();
1173  StringRef EnvironmentTypeName = getEnvironmentTypeName(getEnvironment());
1174  if (EnvironmentName.startswith(EnvironmentTypeName))
1175  EnvironmentName = EnvironmentName.substr(EnvironmentTypeName.size());
1176 
1177  return parseVersionFromName(EnvironmentName);
1178 }
1179 
1181  StringRef OSName = getOSName();
1182  // Assume that the OS portion of the triple starts with the canonical name.
1183  StringRef OSTypeName = getOSTypeName(getOS());
1184  if (OSName.startswith(OSTypeName))
1185  OSName = OSName.substr(OSTypeName.size());
1186  else if (getOS() == MacOSX)
1187  OSName.consume_front("macos");
1188 
1189  return parseVersionFromName(OSName);
1190 }
1191 
1193  Version = getOSVersion();
1194 
1195  switch (getOS()) {
1196  default: llvm_unreachable("unexpected OS for Darwin triple");
1197  case Darwin:
1198  // Default to darwin8, i.e., MacOSX 10.4.
1199  if (Version.getMajor() == 0)
1200  Version = VersionTuple(8);
1201  // Darwin version numbers are skewed from OS X versions.
1202  if (Version.getMajor() < 4) {
1203  return false;
1204  }
1205  if (Version.getMajor() <= 19) {
1206  Version = VersionTuple(10, Version.getMajor() - 4);
1207  } else {
1208  // darwin20+ corresponds to macOS 11+.
1209  Version = VersionTuple(11 + Version.getMajor() - 20);
1210  }
1211  break;
1212  case MacOSX:
1213  // Default to 10.4.
1214  if (Version.getMajor() == 0) {
1215  Version = VersionTuple(10, 4);
1216  } else if (Version.getMajor() < 10) {
1217  return false;
1218  }
1219  break;
1220  case IOS:
1221  case TvOS:
1222  case WatchOS:
1223  // Ignore the version from the triple. This is only handled because the
1224  // the clang driver combines OS X and IOS support into a common Darwin
1225  // toolchain that wants to know the OS X version number even when targeting
1226  // IOS.
1227  Version = VersionTuple(10, 4);
1228  break;
1229  case DriverKit:
1230  llvm_unreachable("OSX version isn't relevant for DriverKit");
1231  }
1232  return true;
1233 }
1234 
1236  switch (getOS()) {
1237  default: llvm_unreachable("unexpected OS for Darwin triple");
1238  case Darwin:
1239  case MacOSX:
1240  // Ignore the version from the triple. This is only handled because the
1241  // the clang driver combines OS X and IOS support into a common Darwin
1242  // toolchain that wants to know the iOS version number even when targeting
1243  // OS X.
1244  return VersionTuple(5);
1245  case IOS:
1246  case TvOS: {
1248  // Default to 5.0 (or 7.0 for arm64).
1249  if (Version.getMajor() == 0)
1250  return (getArch() == aarch64) ? VersionTuple(7) : VersionTuple(5);
1251  return Version;
1252  }
1253  case WatchOS:
1254  llvm_unreachable("conflicting triple info");
1255  case DriverKit:
1256  llvm_unreachable("DriverKit doesn't have an iOS version");
1257  }
1258 }
1259 
1261  switch (getOS()) {
1262  default: llvm_unreachable("unexpected OS for Darwin triple");
1263  case Darwin:
1264  case MacOSX:
1265  // Ignore the version from the triple. This is only handled because the
1266  // the clang driver combines OS X and IOS support into a common Darwin
1267  // toolchain that wants to know the iOS version number even when targeting
1268  // OS X.
1269  return VersionTuple(2);
1270  case WatchOS: {
1272  if (Version.getMajor() == 0)
1273  return VersionTuple(2);
1274  return Version;
1275  }
1276  case IOS:
1277  llvm_unreachable("conflicting triple info");
1278  case DriverKit:
1279  llvm_unreachable("DriverKit doesn't have a WatchOS version");
1280  }
1281 }
1282 
1284  switch (getOS()) {
1285  default:
1286  llvm_unreachable("unexpected OS for Darwin triple");
1287  case DriverKit:
1289  if (Version.getMajor() == 0)
1290  return Version.withMajorReplaced(19);
1291  return Version;
1292  }
1293 }
1294 
1295 void Triple::setTriple(const Twine &Str) {
1296  *this = Triple(Str);
1297 }
1298 
1300  setArchName(getArchName(Kind, SubArch));
1301 }
1302 
1305 }
1306 
1309 }
1310 
1312  if (ObjectFormat == getDefaultFormat(*this))
1314 
1316  getObjectFormatTypeName(ObjectFormat)).str());
1317 }
1318 
1320  if (Environment == UnknownEnvironment)
1322 
1323  setEnvironmentName((getEnvironmentTypeName(Environment) + Twine("-") +
1325 }
1326 
1328  // Work around a miscompilation bug for Twines in gcc 4.0.3.
1330  Triple += Str;
1331  Triple += "-";
1332  Triple += getVendorName();
1333  Triple += "-";
1335  setTriple(Triple);
1336 }
1337 
1339  setTriple(getArchName() + "-" + Str + "-" + getOSAndEnvironmentName());
1340 }
1341 
1343  if (hasEnvironment())
1344  setTriple(getArchName() + "-" + getVendorName() + "-" + Str +
1345  "-" + getEnvironmentName());
1346  else
1347  setTriple(getArchName() + "-" + getVendorName() + "-" + Str);
1348 }
1349 
1351  setTriple(getArchName() + "-" + getVendorName() + "-" + getOSName() +
1352  "-" + Str);
1353 }
1354 
1356  setTriple(getArchName() + "-" + getVendorName() + "-" + Str);
1357 }
1358 
1360  switch (Arch) {
1362  return 0;
1363 
1364  case llvm::Triple::avr:
1365  case llvm::Triple::msp430:
1366  return 16;
1367 
1369  case llvm::Triple::amdil:
1370  case llvm::Triple::arc:
1371  case llvm::Triple::arm:
1372  case llvm::Triple::armeb:
1373  case llvm::Triple::csky:
1374  case llvm::Triple::dxil:
1375  case llvm::Triple::hexagon:
1376  case llvm::Triple::hsail:
1377  case llvm::Triple::kalimba:
1378  case llvm::Triple::lanai:
1379  case llvm::Triple::le32:
1381  case llvm::Triple::m68k:
1382  case llvm::Triple::mips:
1383  case llvm::Triple::mipsel:
1384  case llvm::Triple::nvptx:
1385  case llvm::Triple::ppc:
1386  case llvm::Triple::ppcle:
1387  case llvm::Triple::r600:
1389  case llvm::Triple::riscv32:
1390  case llvm::Triple::shave:
1391  case llvm::Triple::sparc:
1392  case llvm::Triple::sparcel:
1393  case llvm::Triple::spir:
1394  case llvm::Triple::spirv32:
1395  case llvm::Triple::tce:
1396  case llvm::Triple::tcele:
1397  case llvm::Triple::thumb:
1398  case llvm::Triple::thumbeb:
1399  case llvm::Triple::wasm32:
1400  case llvm::Triple::x86:
1401  case llvm::Triple::xcore:
1402  return 32;
1403 
1404  case llvm::Triple::aarch64:
1406  case llvm::Triple::amdgcn:
1407  case llvm::Triple::amdil64:
1408  case llvm::Triple::bpfeb:
1409  case llvm::Triple::bpfel:
1410  case llvm::Triple::hsail64:
1411  case llvm::Triple::le64:
1413  case llvm::Triple::mips64:
1415  case llvm::Triple::nvptx64:
1416  case llvm::Triple::ppc64:
1417  case llvm::Triple::ppc64le:
1419  case llvm::Triple::riscv64:
1420  case llvm::Triple::sparcv9:
1421  case llvm::Triple::spir64:
1422  case llvm::Triple::spirv64:
1423  case llvm::Triple::systemz:
1424  case llvm::Triple::ve:
1425  case llvm::Triple::wasm64:
1426  case llvm::Triple::x86_64:
1427  return 64;
1428  }
1429  llvm_unreachable("Invalid architecture value");
1430 }
1431 
1432 bool Triple::isArch64Bit() const {
1433  return getArchPointerBitWidth(getArch()) == 64;
1434 }
1435 
1436 bool Triple::isArch32Bit() const {
1437  return getArchPointerBitWidth(getArch()) == 32;
1438 }
1439 
1440 bool Triple::isArch16Bit() const {
1441  return getArchPointerBitWidth(getArch()) == 16;
1442 }
1443 
1445  Triple T(*this);
1446  switch (getArch()) {
1447  case Triple::UnknownArch:
1448  case Triple::amdgcn:
1449  case Triple::avr:
1450  case Triple::bpfeb:
1451  case Triple::bpfel:
1452  case Triple::msp430:
1453  case Triple::systemz:
1454  case Triple::ve:
1455  T.setArch(UnknownArch);
1456  break;
1457 
1458  case Triple::aarch64_32:
1459  case Triple::amdil:
1460  case Triple::arc:
1461  case Triple::arm:
1462  case Triple::armeb:
1463  case Triple::csky:
1464  case Triple::dxil:
1465  case Triple::hexagon:
1466  case Triple::hsail:
1467  case Triple::kalimba:
1468  case Triple::lanai:
1469  case Triple::le32:
1470  case Triple::loongarch32:
1471  case Triple::m68k:
1472  case Triple::mips:
1473  case Triple::mipsel:
1474  case Triple::nvptx:
1475  case Triple::ppc:
1476  case Triple::ppcle:
1477  case Triple::r600:
1479  case Triple::riscv32:
1480  case Triple::shave:
1481  case Triple::sparc:
1482  case Triple::sparcel:
1483  case Triple::spir:
1484  case Triple::spirv32:
1485  case Triple::tce:
1486  case Triple::tcele:
1487  case Triple::thumb:
1488  case Triple::thumbeb:
1489  case Triple::wasm32:
1490  case Triple::x86:
1491  case Triple::xcore:
1492  // Already 32-bit.
1493  break;
1494 
1495  case Triple::aarch64: T.setArch(Triple::arm); break;
1496  case Triple::aarch64_be: T.setArch(Triple::armeb); break;
1497  case Triple::amdil64: T.setArch(Triple::amdil); break;
1498  case Triple::hsail64: T.setArch(Triple::hsail); break;
1499  case Triple::le64: T.setArch(Triple::le32); break;
1500  case Triple::loongarch64: T.setArch(Triple::loongarch32); break;
1501  case Triple::mips64:
1502  T.setArch(Triple::mips, getSubArch());
1503  break;
1504  case Triple::mips64el:
1505  T.setArch(Triple::mipsel, getSubArch());
1506  break;
1507  case Triple::nvptx64: T.setArch(Triple::nvptx); break;
1508  case Triple::ppc64: T.setArch(Triple::ppc); break;
1509  case Triple::ppc64le: T.setArch(Triple::ppcle); break;
1510  case Triple::renderscript64: T.setArch(Triple::renderscript32); break;
1511  case Triple::riscv64: T.setArch(Triple::riscv32); break;
1512  case Triple::sparcv9: T.setArch(Triple::sparc); break;
1513  case Triple::spir64: T.setArch(Triple::spir); break;
1514  case Triple::spirv64: T.setArch(Triple::spirv32); break;
1515  case Triple::wasm64: T.setArch(Triple::wasm32); break;
1516  case Triple::x86_64: T.setArch(Triple::x86); break;
1517  }
1518  return T;
1519 }
1520 
1522  Triple T(*this);
1523  switch (getArch()) {
1524  case Triple::UnknownArch:
1525  case Triple::arc:
1526  case Triple::avr:
1527  case Triple::csky:
1528  case Triple::dxil:
1529  case Triple::hexagon:
1530  case Triple::kalimba:
1531  case Triple::lanai:
1532  case Triple::m68k:
1533  case Triple::msp430:
1534  case Triple::r600:
1535  case Triple::shave:
1536  case Triple::sparcel:
1537  case Triple::tce:
1538  case Triple::tcele:
1539  case Triple::xcore:
1540  T.setArch(UnknownArch);
1541  break;
1542 
1543  case Triple::aarch64:
1544  case Triple::aarch64_be:
1545  case Triple::amdgcn:
1546  case Triple::amdil64:
1547  case Triple::bpfeb:
1548  case Triple::bpfel:
1549  case Triple::hsail64:
1550  case Triple::le64:
1551  case Triple::loongarch64:
1552  case Triple::mips64:
1553  case Triple::mips64el:
1554  case Triple::nvptx64:
1555  case Triple::ppc64:
1556  case Triple::ppc64le:
1558  case Triple::riscv64:
1559  case Triple::sparcv9:
1560  case Triple::spir64:
1561  case Triple::spirv64:
1562  case Triple::systemz:
1563  case Triple::ve:
1564  case Triple::wasm64:
1565  case Triple::x86_64:
1566  // Already 64-bit.
1567  break;
1568 
1569  case Triple::aarch64_32: T.setArch(Triple::aarch64); break;
1570  case Triple::amdil: T.setArch(Triple::amdil64); break;
1571  case Triple::arm: T.setArch(Triple::aarch64); break;
1572  case Triple::armeb: T.setArch(Triple::aarch64_be); break;
1573  case Triple::hsail: T.setArch(Triple::hsail64); break;
1574  case Triple::le32: T.setArch(Triple::le64); break;
1575  case Triple::loongarch32: T.setArch(Triple::loongarch64); break;
1576  case Triple::mips:
1577  T.setArch(Triple::mips64, getSubArch());
1578  break;
1579  case Triple::mipsel:
1580  T.setArch(Triple::mips64el, getSubArch());
1581  break;
1582  case Triple::nvptx: T.setArch(Triple::nvptx64); break;
1583  case Triple::ppc: T.setArch(Triple::ppc64); break;
1584  case Triple::ppcle: T.setArch(Triple::ppc64le); break;
1585  case Triple::renderscript32: T.setArch(Triple::renderscript64); break;
1586  case Triple::riscv32: T.setArch(Triple::riscv64); break;
1587  case Triple::sparc: T.setArch(Triple::sparcv9); break;
1588  case Triple::spir: T.setArch(Triple::spir64); break;
1589  case Triple::spirv32: T.setArch(Triple::spirv64); break;
1590  case Triple::thumb: T.setArch(Triple::aarch64); break;
1591  case Triple::thumbeb: T.setArch(Triple::aarch64_be); break;
1592  case Triple::wasm32: T.setArch(Triple::wasm64); break;
1593  case Triple::x86: T.setArch(Triple::x86_64); break;
1594  }
1595  return T;
1596 }
1597 
1599  Triple T(*this);
1600  // Already big endian.
1601  if (!isLittleEndian())
1602  return T;
1603  switch (getArch()) {
1604  case Triple::UnknownArch:
1605  case Triple::amdgcn:
1606  case Triple::amdil64:
1607  case Triple::amdil:
1608  case Triple::avr:
1609  case Triple::dxil:
1610  case Triple::hexagon:
1611  case Triple::hsail64:
1612  case Triple::hsail:
1613  case Triple::kalimba:
1614  case Triple::le32:
1615  case Triple::le64:
1616  case Triple::loongarch32:
1617  case Triple::loongarch64:
1618  case Triple::msp430:
1619  case Triple::nvptx64:
1620  case Triple::nvptx:
1621  case Triple::r600:
1624  case Triple::riscv32:
1625  case Triple::riscv64:
1626  case Triple::shave:
1627  case Triple::spir64:
1628  case Triple::spir:
1629  case Triple::spirv32:
1630  case Triple::spirv64:
1631  case Triple::wasm32:
1632  case Triple::wasm64:
1633  case Triple::x86:
1634  case Triple::x86_64:
1635  case Triple::xcore:
1636  case Triple::ve:
1637  case Triple::csky:
1638 
1639  // ARM is intentionally unsupported here, changing the architecture would
1640  // drop any arch suffixes.
1641  case Triple::arm:
1642  case Triple::thumb:
1643  T.setArch(UnknownArch);
1644  break;
1645 
1646  case Triple::aarch64: T.setArch(Triple::aarch64_be); break;
1647  case Triple::bpfel: T.setArch(Triple::bpfeb); break;
1648  case Triple::mips64el:
1649  T.setArch(Triple::mips64, getSubArch());
1650  break;
1651  case Triple::mipsel:
1652  T.setArch(Triple::mips, getSubArch());
1653  break;
1654  case Triple::ppcle: T.setArch(Triple::ppc); break;
1655  case Triple::ppc64le: T.setArch(Triple::ppc64); break;
1656  case Triple::sparcel: T.setArch(Triple::sparc); break;
1657  case Triple::tcele: T.setArch(Triple::tce); break;
1658  default:
1659  llvm_unreachable("getBigEndianArchVariant: unknown triple.");
1660  }
1661  return T;
1662 }
1663 
1665  Triple T(*this);
1666  if (isLittleEndian())
1667  return T;
1668 
1669  switch (getArch()) {
1670  case Triple::UnknownArch:
1671  case Triple::lanai:
1672  case Triple::sparcv9:
1673  case Triple::systemz:
1674  case Triple::m68k:
1675 
1676  // ARM is intentionally unsupported here, changing the architecture would
1677  // drop any arch suffixes.
1678  case Triple::armeb:
1679  case Triple::thumbeb:
1680  T.setArch(UnknownArch);
1681  break;
1682 
1683  case Triple::aarch64_be: T.setArch(Triple::aarch64); break;
1684  case Triple::bpfeb: T.setArch(Triple::bpfel); break;
1685  case Triple::mips64:
1686  T.setArch(Triple::mips64el, getSubArch());
1687  break;
1688  case Triple::mips:
1689  T.setArch(Triple::mipsel, getSubArch());
1690  break;
1691  case Triple::ppc: T.setArch(Triple::ppcle); break;
1692  case Triple::ppc64: T.setArch(Triple::ppc64le); break;
1693  case Triple::sparc: T.setArch(Triple::sparcel); break;
1694  case Triple::tce: T.setArch(Triple::tcele); break;
1695  default:
1696  llvm_unreachable("getLittleEndianArchVariant: unknown triple.");
1697  }
1698  return T;
1699 }
1700 
1702  switch (getArch()) {
1703  case Triple::aarch64:
1704  case Triple::aarch64_32:
1705  case Triple::amdgcn:
1706  case Triple::amdil64:
1707  case Triple::amdil:
1708  case Triple::arm:
1709  case Triple::avr:
1710  case Triple::bpfel:
1711  case Triple::csky:
1712  case Triple::dxil:
1713  case Triple::hexagon:
1714  case Triple::hsail64:
1715  case Triple::hsail:
1716  case Triple::kalimba:
1717  case Triple::le32:
1718  case Triple::le64:
1719  case Triple::loongarch32:
1720  case Triple::loongarch64:
1721  case Triple::mips64el:
1722  case Triple::mipsel:
1723  case Triple::msp430:
1724  case Triple::nvptx64:
1725  case Triple::nvptx:
1726  case Triple::ppcle:
1727  case Triple::ppc64le:
1728  case Triple::r600:
1731  case Triple::riscv32:
1732  case Triple::riscv64:
1733  case Triple::shave:
1734  case Triple::sparcel:
1735  case Triple::spir64:
1736  case Triple::spir:
1737  case Triple::spirv32:
1738  case Triple::spirv64:
1739  case Triple::tcele:
1740  case Triple::thumb:
1741  case Triple::ve:
1742  case Triple::wasm32:
1743  case Triple::wasm64:
1744  case Triple::x86:
1745  case Triple::x86_64:
1746  case Triple::xcore:
1747  return true;
1748  default:
1749  return false;
1750  }
1751 }
1752 
1753 bool Triple::isCompatibleWith(const Triple &Other) const {
1754  // ARM and Thumb triples are compatible, if subarch, vendor and OS match.
1755  if ((getArch() == Triple::thumb && Other.getArch() == Triple::arm) ||
1756  (getArch() == Triple::arm && Other.getArch() == Triple::thumb) ||
1757  (getArch() == Triple::thumbeb && Other.getArch() == Triple::armeb) ||
1758  (getArch() == Triple::armeb && Other.getArch() == Triple::thumbeb)) {
1759  if (getVendor() == Triple::Apple)
1760  return getSubArch() == Other.getSubArch() &&
1761  getVendor() == Other.getVendor() && getOS() == Other.getOS();
1762  else
1763  return getSubArch() == Other.getSubArch() &&
1764  getVendor() == Other.getVendor() && getOS() == Other.getOS() &&
1765  getEnvironment() == Other.getEnvironment() &&
1766  getObjectFormat() == Other.getObjectFormat();
1767  }
1768 
1769  // If vendor is apple, ignore the version number.
1770  if (getVendor() == Triple::Apple)
1771  return getArch() == Other.getArch() && getSubArch() == Other.getSubArch() &&
1772  getVendor() == Other.getVendor() && getOS() == Other.getOS();
1773 
1774  return *this == Other;
1775 }
1776 
1777 std::string Triple::merge(const Triple &Other) const {
1778  // If vendor is apple, pick the triple with the larger version number.
1779  if (getVendor() == Triple::Apple)
1780  if (Other.isOSVersionLT(*this))
1781  return str();
1782 
1783  return Other.str();
1784 }
1785 
1786 bool Triple::isMacOSXVersionLT(unsigned Major, unsigned Minor,
1787  unsigned Micro) const {
1788  assert(isMacOSX() && "Not an OS X triple!");
1789 
1790  // If this is OS X, expect a sane version number.
1791  if (getOS() == Triple::MacOSX)
1792  return isOSVersionLT(Major, Minor, Micro);
1793 
1794  // Otherwise, compare to the "Darwin" number.
1795  if (Major == 10) {
1796  return isOSVersionLT(Minor + 4, Micro, 0);
1797  } else {
1798  assert(Major >= 11 && "Unexpected major version");
1799  return isOSVersionLT(Major - 11 + 20, Minor, Micro);
1800  }
1801 }
1802 
1805  return VersionTuple();
1806  switch (getOS()) {
1807  case Triple::MacOSX:
1808  // ARM64 slice is supported starting from macOS 11.0+.
1809  return VersionTuple(11, 0, 0);
1810  case Triple::IOS:
1811  // ARM64 slice is supported starting from Mac Catalyst 14 (macOS 11).
1812  // ARM64 simulators are supported for iOS 14+.
1814  return VersionTuple(14, 0, 0);
1815  // ARM64e slice is supported starting from iOS 14.
1816  if (isArm64e())
1817  return VersionTuple(14, 0, 0);
1818  break;
1819  case Triple::TvOS:
1820  // ARM64 simulators are supported for tvOS 14+.
1821  if (isSimulatorEnvironment())
1822  return VersionTuple(14, 0, 0);
1823  break;
1824  case Triple::WatchOS:
1825  // ARM64 simulators are supported for watchOS 7+.
1826  if (isSimulatorEnvironment())
1827  return VersionTuple(7, 0, 0);
1828  break;
1829  case Triple::DriverKit:
1830  return VersionTuple(20, 0, 0);
1831  default:
1832  break;
1833  }
1834  return VersionTuple();
1835 }
1836 
1838  if (MArch.empty())
1839  MArch = getArchName();
1840  MArch = ARM::getCanonicalArchName(MArch);
1841 
1842  // Some defaults are forced.
1843  switch (getOS()) {
1844  case llvm::Triple::FreeBSD:
1845  case llvm::Triple::NetBSD:
1846  case llvm::Triple::OpenBSD:
1847  if (!MArch.empty() && MArch == "v6")
1848  return "arm1176jzf-s";
1849  if (!MArch.empty() && MArch == "v7")
1850  return "cortex-a8";
1851  break;
1852  case llvm::Triple::Win32:
1853  // FIXME: this is invalid for WindowsCE
1854  if (ARM::parseArchVersion(MArch) <= 7)
1855  return "cortex-a9";
1856  break;
1857  case llvm::Triple::IOS:
1858  case llvm::Triple::MacOSX:
1859  case llvm::Triple::TvOS:
1860  case llvm::Triple::WatchOS:
1862  if (MArch == "v7k")
1863  return "cortex-a7";
1864  break;
1865  default:
1866  break;
1867  }
1868 
1869  if (MArch.empty())
1870  return StringRef();
1871 
1872  StringRef CPU = ARM::getDefaultCPU(MArch);
1873  if (!CPU.empty() && !CPU.equals("invalid"))
1874  return CPU;
1875 
1876  // If no specific architecture version is requested, return the minimum CPU
1877  // required by the OS and environment.
1878  switch (getOS()) {
1879  case llvm::Triple::NetBSD:
1880  switch (getEnvironment()) {
1881  case llvm::Triple::EABI:
1882  case llvm::Triple::EABIHF:
1883  case llvm::Triple::GNUEABI:
1885  return "arm926ej-s";
1886  default:
1887  return "strongarm";
1888  }
1889  case llvm::Triple::NaCl:
1890  case llvm::Triple::OpenBSD:
1891  return "cortex-a8";
1892  default:
1893  switch (getEnvironment()) {
1894  case llvm::Triple::EABIHF:
1897  return "arm1176jzf-s";
1898  default:
1899  return "arm7tdmi";
1900  }
1901  }
1902 
1903  llvm_unreachable("invalid arch name");
1904 }
1905 
1907  const VersionTuple &Version) {
1908  switch (OSKind) {
1909  case MacOSX:
1910  // macOS 10.16 is canonicalized to macOS 11.
1911  if (Version == VersionTuple(10, 16))
1912  return VersionTuple(11, 0);
1914  default:
1915  return Version;
1916  }
1917 }
1918 
1919 // HLSL triple environment orders are relied on in the front end
1920 static_assert(Triple::Vertex - Triple::Pixel == 1,
1921  "incorrect HLSL stage order");
1922 static_assert(Triple::Geometry - Triple::Pixel == 2,
1923  "incorrect HLSL stage order");
1924 static_assert(Triple::Hull - Triple::Pixel == 3,
1925  "incorrect HLSL stage order");
1926 static_assert(Triple::Domain - Triple::Pixel == 4,
1927  "incorrect HLSL stage order");
1928 static_assert(Triple::Compute - Triple::Pixel == 5,
1929  "incorrect HLSL stage order");
1930 static_assert(Triple::Library - Triple::Pixel == 6,
1931  "incorrect HLSL stage order");
1932 static_assert(Triple::RayGeneration - Triple::Pixel == 7,
1933  "incorrect HLSL stage order");
1934 static_assert(Triple::Intersection - Triple::Pixel == 8,
1935  "incorrect HLSL stage order");
1936 static_assert(Triple::AnyHit - Triple::Pixel == 9,
1937  "incorrect HLSL stage order");
1938 static_assert(Triple::ClosestHit - Triple::Pixel == 10,
1939  "incorrect HLSL stage order");
1940 static_assert(Triple::Miss - Triple::Pixel == 11,
1941  "incorrect HLSL stage order");
1942 static_assert(Triple::Callable - Triple::Pixel == 12,
1943  "incorrect HLSL stage order");
1944 static_assert(Triple::Mesh - Triple::Pixel == 13,
1945  "incorrect HLSL stage order");
1946 static_assert(Triple::Amplification - Triple::Pixel == 14,
1947  "incorrect HLSL stage order");
llvm::Triple::setEnvironment
void setEnvironment(EnvironmentType Kind)
Set the environment (fourth) component of the triple to a known type.
Definition: Triple.cpp:1311
llvm::Triple::getMacOSXVersion
bool getMacOSXVersion(VersionTuple &Version) const
Parse the version number as with getOSVersion and then translate generic "darwin" versions to the cor...
Definition: Triple.cpp:1192
llvm::StringSwitch::Case
StringSwitch & Case(StringLiteral S, T Value)
Definition: StringSwitch.h:69
llvm::Triple::DXContainer
@ DXContainer
Definition: Triple.h:265
i
i
Definition: README.txt:29
llvm::Triple::isMacOSXVersionLT
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Comparison function for checking OS X version compatibility, which handles supporting skewed version ...
Definition: Triple.cpp:1786
llvm::Triple::setVendorName
void setVendorName(StringRef Str)
Set the vendor (second) component of the triple by name.
Definition: Triple.cpp:1338
llvm::Triple::riscv64
@ riscv64
Definition: Triple.h:76
llvm::Triple::Wasm
@ Wasm
Definition: Triple.h:270
llvm::Triple::getARMCPUForArch
StringRef getARMCPUForArch(StringRef Arch=StringRef()) const
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
Definition: Triple.cpp:1837
llvm::Triple::spir64
@ spir64
Definition: Triple.h:97
getObjectFormatTypeName
static StringRef getObjectFormatTypeName(Triple::ObjectFormatType Kind)
Definition: Triple.cpp:742
llvm::Triple::setTriple
void setTriple(const Twine &Str)
Set all components to the new triple Str.
Definition: Triple.cpp:1295
llvm::StringRef::startswith
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:286
llvm::Triple::Mesa
@ Mesa
Definition: Triple.h:168
llvm::StringSwitch::StartsWith
StringSwitch & StartsWith(StringLiteral S, T Value)
Definition: StringSwitch.h:83
llvm::ARM::EndianKind::BIG
@ BIG
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::ARM::EndianKind
EndianKind
Definition: ARMTargetParser.h:166
llvm::Triple::GNUILP32
@ GNUILP32
Definition: Triple.h:225
llvm::Triple::bpfeb
@ bpfeb
Definition: Triple.h:57
llvm::Triple::Lv2
@ Lv2
Definition: Triple.h:185
llvm::Triple::UnknownArch
@ UnknownArch
Definition: Triple.h:47
llvm::ARM::getCanonicalArchName
StringRef getCanonicalArchName(StringRef Arch)
Definition: ARMTargetParser.cpp:295
llvm::Triple::hsail
@ hsail
Definition: Triple.h:94
llvm::ARM::ISAKind::THUMB
@ THUMB
llvm::Triple::HermitCore
@ HermitCore
Definition: Triple.h:209
llvm::Triple::wasm32
@ wasm32
Definition: Triple.h:103
llvm::StringRef::endswith
LLVM_NODISCARD bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
Definition: StringRef.h:297
llvm::Triple::Amplification
@ Amplification
Definition: Triple.h:257
llvm::Triple::Callable
@ Callable
Definition: Triple.h:255
llvm::Triple::CUDA
@ CUDA
Definition: Triple.h:197
llvm::Triple::Darwin
@ Darwin
Definition: Triple.h:178
llvm::StringSwitch::Default
LLVM_NODISCARD R Default(T Value)
Definition: StringSwitch.h:183
llvm::Triple::KalimbaSubArch_v3
@ KalimbaSubArch_v3
Definition: Triple.h:146
llvm::Triple::EnvironmentType
EnvironmentType
Definition: Triple.h:216
llvm::Triple::ARMSubArch_v8m_mainline
@ ARMSubArch_v8m_mainline
Definition: Triple.h:128
llvm::Triple::x86
@ x86
Definition: Triple.h:85
llvm::Triple::getWatchOSVersion
VersionTuple getWatchOSVersion() const
Parse the version number as with getOSVersion.
Definition: Triple.cpp:1260
llvm::Triple::SubArchType
SubArchType
Definition: Triple.h:110
Host.h
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1185
llvm::StringSwitch::EndsWith
StringSwitch & EndsWith(StringLiteral S, T Value)
Definition: StringSwitch.h:76
llvm::Triple::amdgcn
@ amdgcn
Definition: Triple.h:74
llvm::Triple::Simulator
@ Simulator
Definition: Triple.h:239
llvm::Triple::amdil
@ amdil
Definition: Triple.h:92
ErrorHandling.h
VersionTuple.h
llvm::Triple::MuslEABIHF
@ MuslEABIHF
Definition: Triple.h:232
llvm::Triple::kalimba
@ kalimba
Definition: Triple.h:100
llvm::Triple::getArchTypeForLLVMName
static ArchType getArchTypeForLLVMName(StringRef Str)
The canonical type for the given LLVM architecture name (e.g., "x86").
Definition: Triple.cpp:307
llvm::Triple::get32BitArchVariant
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
Definition: Triple.cpp:1444
llvm::StringRef::consume_front
bool consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
Definition: StringRef.h:682
llvm::Triple::IOS
@ IOS
Definition: Triple.h:182
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
SwapByteOrder.h
llvm::ARM::parseArchProfile
ProfileKind parseArchProfile(StringRef Arch)
Definition: ARMTargetParser.cpp:98
llvm::Triple::renderscript32
@ renderscript32
Definition: Triple.h:105
llvm::Triple::getEnvironmentVersion
VersionTuple getEnvironmentVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition: Triple.cpp:1171
llvm::ARM::ProfileKind
ProfileKind
Definition: ARMTargetParser.h:169
llvm::Triple::getOSAndEnvironmentName
StringRef getOSAndEnvironmentName() const
Get the operating system and optional environment components as a single string (separated by a '-' i...
Definition: Triple.cpp:1160
llvm::Triple::Minix
@ Minix
Definition: Triple.h:193
llvm::Triple::KalimbaSubArch_v5
@ KalimbaSubArch_v5
Definition: Triple.h:148
startswith
static bool startswith(StringRef Magic, const char(&S)[N])
Definition: Magic.cpp:28
llvm::Triple::x86_64
@ x86_64
Definition: Triple.h:86
llvm::Triple::CSR
@ CSR
Definition: Triple.h:165
llvm::Triple::OpenBSD
@ OpenBSD
Definition: Triple.h:188
getDefaultFormat
static Triple::ObjectFormatType getDefaultFormat(const Triple &T)
Definition: Triple.cpp:766
llvm::Triple::Ananas
@ Ananas
Definition: Triple.h:176
llvm::Triple::getMinimumSupportedOSVersion
VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
Definition: Triple.cpp:1803
llvm::Triple::SPIRV
@ SPIRV
Definition: Triple.h:269
llvm::Triple::ppc
@ ppc
Definition: Triple.h:69
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::Triple::nvptx
@ nvptx
Definition: Triple.h:88
llvm::Triple::hexagon
@ hexagon
Definition: Triple.h:60
llvm::Triple::XCOFF
@ XCOFF
Definition: Triple.h:271
parseSubArch
static Triple::SubArchType parseSubArch(StringRef SubArchName)
Definition: Triple.cpp:646
llvm::Triple::KalimbaSubArch_v4
@ KalimbaSubArch_v4
Definition: Triple.h:147
llvm::Triple::merge
std::string merge(const Triple &Other) const
Merge target triples.
Definition: Triple.cpp:1777
llvm::Triple::NVIDIA
@ NVIDIA
Definition: Triple.h:164
llvm::Triple::spirv32
@ spirv32
Definition: Triple.h:98
parseFormat
static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName)
Definition: Triple.cpp:632
llvm::Triple::avr
@ avr
Definition: Triple.h:55
llvm::Triple::aarch64_32
@ aarch64_32
Definition: Triple.h:53
llvm::Triple::le32
@ le32
Definition: Triple.h:90
llvm::Triple::mips64
@ mips64
Definition: Triple.h:66
llvm::Triple::DragonFly
@ DragonFly
Definition: Triple.h:179
llvm::Data
@ Data
Definition: SIMachineScheduler.h:55
llvm::Triple::WatchOS
@ WatchOS
Definition: Triple.h:204
llvm::Triple::GNUEABI
@ GNUEABI
Definition: Triple.h:222
llvm::Triple::ARMSubArch_v8m_baseline
@ ARMSubArch_v8m_baseline
Definition: Triple.h:127
llvm::Triple::getCanonicalVersionForOS
static VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version)
Returns a canonicalized OS version number for the specified OS.
Definition: Triple.cpp:1906
llvm::Triple::setOSAndEnvironmentName
void setOSAndEnvironmentName(StringRef Str)
Set the operating system and optional environment components with a single string.
Definition: Triple.cpp:1355
llvm::Triple::isArch64Bit
bool isArch64Bit() const
Test whether the architecture is 64-bit.
Definition: Triple.cpp:1432
llvm::Triple::GNU
@ GNU
Definition: Triple.h:219
llvm::Triple::ShaderModel
@ ShaderModel
Definition: Triple.h:213
llvm::Triple::ARMSubArch_v8_1m_mainline
@ ARMSubArch_v8_1m_mainline
Definition: Triple.h:129
llvm::Triple::ARMSubArch_v9
@ ARMSubArch_v9
Definition: Triple.h:116
llvm::StringRef::substr
LLVM_NODISCARD StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
Definition: StringRef.h:611
llvm::Triple::Vertex
@ Vertex
Definition: Triple.h:244
llvm::Triple::isMacOSX
bool isMacOSX() const
Is this a Mac OS X triple.
Definition: Triple.h:467
llvm::Triple::hsail64
@ hsail64
Definition: Triple.h:95
llvm::Triple::isCompatibleWith
bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
Definition: Triple.cpp:1753
llvm::Triple::isLittleEndian
bool isLittleEndian() const
Tests whether the target triple is little endian.
Definition: Triple.cpp:1701
llvm::Triple::sparc
@ sparc
Definition: Triple.h:77
llvm::Triple::Musl
@ Musl
Definition: Triple.h:230
llvm::Triple::FreeBSD
@ FreeBSD
Definition: Triple.h:180
llvm::Triple::sparcv9
@ sparcv9
Definition: Triple.h:78
llvm::Triple::sparcel
@ sparcel
Definition: Triple.h:79
llvm::Triple::get64BitArchVariant
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
Definition: Triple.cpp:1521
llvm::Triple::ARMSubArch_v8_2a
@ ARMSubArch_v8_2a
Definition: Triple.h:123
llvm::Triple::ArchType
ArchType
Definition: Triple.h:46
llvm::Triple::ARMSubArch_v5
@ ARMSubArch_v5
Definition: Triple.h:140
llvm::Triple::GNUABI64
@ GNUABI64
Definition: Triple.h:221
parseEnvironment
static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName)
Definition: Triple.cpp:591
SmallString.h
llvm::Triple::TvOS
@ TvOS
Definition: Triple.h:203
llvm::Triple::str
const std::string & str() const
Definition: Triple.h:396
llvm::Triple::ARMSubArch_v8_4a
@ ARMSubArch_v8_4a
Definition: Triple.h:121
llvm::StringRef::split
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
Definition: StringRef.h:749
llvm::Triple::Cygnus
@ Cygnus
Definition: Triple.h:237
llvm::Triple::ARMSubArch_v8r
@ ARMSubArch_v8r
Definition: Triple.h:126
llvm::Triple::getOSVersion
VersionTuple getOSVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition: Triple.cpp:1180
llvm::Triple::Mesa3D
@ Mesa3D
Definition: Triple.h:206
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::Triple::mips64el
@ mips64el
Definition: Triple.h:67
llvm::Triple::PC
@ PC
Definition: Triple.h:158
llvm::Triple::CODE16
@ CODE16
Definition: Triple.h:226
llvm::Triple::nvptx64
@ nvptx64
Definition: Triple.h:89
getArchPointerBitWidth
static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch)
Definition: Triple.cpp:1359
parseOS
static Triple::OSType parseOS(StringRef OSName)
Definition: Triple.cpp:547
llvm::Triple::PS4
@ PS4
Definition: Triple.h:200
llvm::Triple::OpenEmbedded
@ OpenEmbedded
Definition: Triple.h:170
llvm::Triple::le64
@ le64
Definition: Triple.h:91
llvm::Triple::Emscripten
@ Emscripten
Definition: Triple.h:212
llvm::Triple::Haiku
@ Haiku
Definition: Triple.h:192
llvm::Triple::MipsSubArch_r6
@ MipsSubArch_r6
Definition: Triple.h:150
llvm::Triple::Freescale
@ Freescale
Definition: Triple.h:160
llvm::Triple::RayGeneration
@ RayGeneration
Definition: Triple.h:250
parseBPFArch
static Triple::ArchType parseBPFArch(StringRef ArchName)
Definition: Triple.cpp:292
llvm::Triple::ppc64
@ ppc64
Definition: Triple.h:71
llvm::Triple::NaCl
@ NaCl
Definition: Triple.h:195
llvm::Triple::NetBSD
@ NetBSD
Definition: Triple.h:187
llvm::Triple::xcore
@ xcore
Definition: Triple.h:87
llvm::Triple::ARMSubArch_v9_1a
@ ARMSubArch_v9_1a
Definition: Triple.h:115
llvm::Triple::setVendor
void setVendor(VendorType Kind)
Set the vendor (second) component of the triple to a known type.
Definition: Triple.cpp:1303
llvm::Triple::setEnvironmentName
void setEnvironmentName(StringRef Str)
Set the optional environment (fourth) component of the triple by name.
Definition: Triple.cpp:1350
parseARMArch
static Triple::ArchType parseARMArch(StringRef ArchName)
Definition: Triple.cpp:377
llvm::Triple::r600
@ r600
Definition: Triple.h:73
llvm::Triple::Win32
@ Win32
Definition: Triple.h:190
llvm::Triple::getObjectFormat
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
Definition: Triple.h:363
llvm::Triple::KFreeBSD
@ KFreeBSD
Definition: Triple.h:183
llvm::Triple::RTEMS
@ RTEMS
Definition: Triple.h:194
llvm::Triple::Geometry
@ Geometry
Definition: Triple.h:245
llvm::Triple::DriverKit
@ DriverKit
Definition: Triple.h:205
llvm::Triple::m68k
@ m68k
Definition: Triple.h:63
llvm::Triple::UnknownEnvironment
@ UnknownEnvironment
Definition: Triple.h:217
llvm::Triple::Intersection
@ Intersection
Definition: Triple.h:251
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:31
llvm::Triple::Hull
@ Hull
Definition: Triple.h:246
llvm::Triple::getArchName
StringRef getArchName() const
Get the architecture (first) component of the triple.
Definition: Triple.cpp:1115
llvm::Triple::lanai
@ lanai
Definition: Triple.h:102
llvm::Triple::MuslEABI
@ MuslEABI
Definition: Triple.h:231
llvm::ARM::parseArch
ArchKind parseArch(StringRef Arch)
Definition: ARMTargetParser.cpp:28
llvm::Triple::getEnvironmentTypeName
static StringRef getEnvironmentTypeName(EnvironmentType Kind)
Get the canonical name for the Kind environment.
Definition: Triple.cpp:248
llvm::Triple::getArch
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition: Triple.h:337
llvm::array_lengthof
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
Definition: STLArrayExtras.h:29
llvm::Triple::GOFF
@ GOFF
Definition: Triple.h:267
llvm::Triple::ARMSubArch_v8_5a
@ ARMSubArch_v8_5a
Definition: Triple.h:120
llvm::Triple::ARMSubArch_v7s
@ ARMSubArch_v7s
Definition: Triple.h:133
llvm::Triple::Compute
@ Compute
Definition: Triple.h:248
llvm::Triple::getiOSVersion
VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
Definition: Triple.cpp:1235
llvm::Triple::Miss
@ Miss
Definition: Triple.h:254
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::Triple::csky
@ csky
Definition: Triple.h:58
llvm::Triple::CoreCLR
@ CoreCLR
Definition: Triple.h:238
llvm::StringRef::equals
LLVM_NODISCARD bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Definition: StringRef.h:187
llvm::Triple::renderscript64
@ renderscript64
Definition: Triple.h:106
llvm::Triple::ARMSubArch_v6k
@ ARMSubArch_v6k
Definition: Triple.h:138
llvm::SmallString< 64 >
llvm::ARM::parseArchEndian
EndianKind parseArchEndian(StringRef Arch)
Definition: ARMTargetParser.cpp:248
llvm::Triple::isOSVersionLT
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Helper function for doing comparisons against version numbers included in the target triple.
Definition: Triple.h:445
llvm::Twine::str
std::string str() const
Return the twine contents as a std::string.
Definition: Twine.cpp:17
llvm::Triple::MuslX32
@ MuslX32
Definition: Triple.h:233
llvm::Triple::AMDHSA
@ AMDHSA
Definition: Triple.h:199
llvm::Triple::getDriverKitVersion
VersionTuple getDriverKitVersion() const
Parse the version number as with getOSVersion.
Definition: Triple.cpp:1283
llvm::Triple::AArch64SubArch_arm64e
@ AArch64SubArch_arm64e
Definition: Triple.h:144
llvm::Triple::ppc64le
@ ppc64le
Definition: Triple.h:72
llvm::Triple::MacOSX
@ MacOSX
Definition: Triple.h:186
llvm::Triple::ELF
@ ELF
Definition: Triple.h:266
parseArch
static Triple::ArchType parseArch(StringRef ArchName)
Definition: Triple.cpp:442
llvm::Triple::ARMSubArch_v8_8a
@ ARMSubArch_v8_8a
Definition: Triple.h:117
llvm::Triple::GNUX32
@ GNUX32
Definition: Triple.h:224
llvm::StringRef::empty
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:153
llvm::Triple::ARMSubArch_v7ve
@ ARMSubArch_v7ve
Definition: Triple.h:135
llvm::Triple::isArch16Bit
bool isArch16Bit() const
Test whether the architecture is 16-bit.
Definition: Triple.cpp:1440
STLArrayExtras.h
llvm::Triple::Android
@ Android
Definition: Triple.h:229
llvm::Triple::Hurd
@ Hurd
Definition: Triple.h:210
llvm::Triple::getOS
OSType getOS() const
Get the parsed operating system type of this triple.
Definition: Triple.h:346
llvm::Triple::arc
@ arc
Definition: Triple.h:54
llvm::Triple::normalize
std::string normalize() const
Return the normalized form of this triple's string.
Definition: Triple.h:330
llvm::Triple::isArch32Bit
bool isArch32Bit() const
Test whether the architecture is 32-bit.
Definition: Triple.cpp:1436
llvm::Triple::MSVC
@ MSVC
Definition: Triple.h:235
llvm::Triple::IBM
@ IBM
Definition: Triple.h:161
llvm::Triple::ARMSubArch_v7k
@ ARMSubArch_v7k
Definition: Triple.h:134
llvm::Triple::NVCL
@ NVCL
Definition: Triple.h:198
llvm::Triple::Linux
@ Linux
Definition: Triple.h:184
llvm::Triple::Solaris
@ Solaris
Definition: Triple.h:189
llvm::Triple::getVendorName
StringRef getVendorName() const
Get the vendor (second) component of the triple.
Definition: Triple.cpp:1143
llvm::Triple::ARMSubArch_v7m
@ ARMSubArch_v7m
Definition: Triple.h:132
StringExtras.h
llvm::Triple::ARMSubArch_v4t
@ ARMSubArch_v4t
Definition: Triple.h:142
llvm::Triple::isSimulatorEnvironment
bool isSimulatorEnvironment() const
Definition: Triple.h:504
llvm::Triple::ImaginationTechnologies
@ ImaginationTechnologies
Definition: Triple.h:162
ARMTargetParser.h
llvm::Triple::ARMSubArch_v8
@ ARMSubArch_v8
Definition: Triple.h:125
llvm::Triple::ARMSubArch_v6m
@ ARMSubArch_v6m
Definition: Triple.h:137
llvm::Triple::setArch
void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)
Set the architecture (first) component of the triple to a known type.
Definition: Triple.cpp:1299
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::Triple::ZOS
@ ZOS
Definition: Triple.h:191
std::swap
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:853
llvm::Triple::bpfel
@ bpfel
Definition: Triple.h:56
llvm::Triple::AMD
@ AMD
Definition: Triple.h:167
llvm::ARM::parseArchVersion
unsigned parseArchVersion(StringRef Arch)
Definition: ARMTargetParser.cpp:39
llvm::Triple::ClosestHit
@ ClosestHit
Definition: Triple.h:253
llvm::Triple::ARMSubArch_v5te
@ ARMSubArch_v5te
Definition: Triple.h:141
llvm::Triple::SCEI
@ SCEI
Definition: Triple.h:159
llvm::Triple::armeb
@ armeb
Definition: Triple.h:50
llvm::Triple::GNUABIN32
@ GNUABIN32
Definition: Triple.h:220
Triple.h
llvm::Triple::loongarch32
@ loongarch32
Definition: Triple.h:61
llvm::Triple::Pixel
@ Pixel
Definition: Triple.h:243
llvm::MSP430Attrs::ISA
ISA
Definition: MSP430Attributes.h:36
llvm::ARM::EndianKind::LITTLE
@ LITTLE
llvm::Triple::arm
@ arm
Definition: Triple.h:49
llvm::ARM::ISAKind
ISAKind
Definition: ARMTargetParser.h:162
llvm::Triple::PS5
@ PS5
Definition: Triple.h:201
llvm::ARM::ISAKind::INVALID
@ INVALID
llvm::Triple::aarch64_be
@ aarch64_be
Definition: Triple.h:52
llvm::Triple::msp430
@ msp430
Definition: Triple.h:68
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::ARM::parseArchISA
ISAKind parseArchISA(StringRef Arch)
Definition: ARMTargetParser.cpp:267
llvm::Triple::ppcle
@ ppcle
Definition: Triple.h:70
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::Triple::ARMSubArch_v8_7a
@ ARMSubArch_v8_7a
Definition: Triple.h:118
llvm::Triple::ARMSubArch_v8_3a
@ ARMSubArch_v8_3a
Definition: Triple.h:122
llvm::Triple::thumb
@ thumb
Definition: Triple.h:83
llvm::Triple::AnyHit
@ AnyHit
Definition: Triple.h:252
llvm::Triple::dxil
@ dxil
Definition: Triple.h:59
Profile
Load MIR Sample Profile
Definition: MIRSampleProfile.cpp:70
llvm::Triple::UnknownVendor
@ UnknownVendor
Definition: Triple.h:155
llvm::Triple::ARMSubArch_v9_3a
@ ARMSubArch_v9_3a
Definition: Triple.h:113
llvm::Triple::ve
@ ve
Definition: Triple.h:107
LLVM_FALLTHROUGH
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:280
llvm::Triple::ObjectFormatType
ObjectFormatType
Definition: Triple.h:261
llvm::StringSwitch::Cases
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
Definition: StringSwitch.h:90
llvm::Triple::ARMSubArch_v7
@ ARMSubArch_v7
Definition: Triple.h:130
llvm::StringRef::size
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
Definition: StringRef.h:157
llvm::Triple::amdil64
@ amdil64
Definition: Triple.h:93
llvm::Triple::setOS
void setOS(OSType Kind)
Set the operating system (third) component of the triple to a known type.
Definition: Triple.cpp:1307
llvm::ARM::getDefaultCPU
StringRef getDefaultCPU(StringRef Arch)
Definition: ARMTargetParser.cpp:559
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::Triple::WASI
@ WASI
Definition: Triple.h:211
llvm::Triple::Mesh
@ Mesh
Definition: Triple.h:256
llvm::Triple::OSType
OSType
Definition: Triple.h:173
llvm::Triple::Itanium
@ Itanium
Definition: Triple.h:236
llvm::Triple::VendorType
VendorType
Definition: Triple.h:154
llvm::Triple::ARMSubArch_v8_6a
@ ARMSubArch_v8_6a
Definition: Triple.h:119
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
llvm::Triple::getOSName
StringRef getOSName() const
Get the operating system (third) component of the triple.
Definition: Triple.cpp:1148
llvm::Triple::ARMSubArch_v6t2
@ ARMSubArch_v6t2
Definition: Triple.h:139
llvm::StringRef::drop_front
LLVM_NODISCARD StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
Definition: StringRef.h:653
llvm::Triple::MipsTechnologies
@ MipsTechnologies
Definition: Triple.h:163
llvm::Triple::getSubArch
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
Definition: Triple.h:340
llvm::ARM::EndianKind::INVALID
@ INVALID
llvm::Triple::Fuchsia
@ Fuchsia
Definition: Triple.h:181
llvm::Triple::riscv32
@ riscv32
Definition: Triple.h:75
llvm::Triple::AMDPAL
@ AMDPAL
Definition: Triple.h:208
llvm::Triple::setOSName
void setOSName(StringRef Str)
Set the operating system (third) component of the triple by name.
Definition: Triple.cpp:1342
llvm::Triple::MachO
@ MachO
Definition: Triple.h:268
llvm::Triple::Contiki
@ Contiki
Definition: Triple.h:207
llvm::Triple::Triple
Triple()
Default constructor is the same as an empty string and leaves all triple fields unknown.
Definition: Triple.h:301
llvm::Triple::getOSTypeName
static StringRef getOSTypeName(OSType Kind)
Get the canonical name for the Kind operating system.
Definition: Triple.cpp:201
llvm::Triple::isArm64e
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
Definition: Triple.h:896
llvm::Triple::mipsel
@ mipsel
Definition: Triple.h:65
llvm::Triple::ELFIAMCU
@ ELFIAMCU
Definition: Triple.h:202
llvm::Triple::getArchTypePrefix
static StringRef getArchTypePrefix(ArchType Kind)
Get the "prefix" canonical name for the Kind architecture.
Definition: Triple.cpp:91
llvm::Triple::ARMSubArch_v7em
@ ARMSubArch_v7em
Definition: Triple.h:131
llvm::Triple::shave
@ shave
Definition: Triple.h:101
llvm::Triple::AIX
@ AIX
Definition: Triple.h:196
llvm::Triple::loongarch64
@ loongarch64
Definition: Triple.h:62
llvm::Triple::tcele
@ tcele
Definition: Triple.h:82
StringSwitch.h
llvm::Triple::spirv64
@ spirv64
Definition: Triple.h:99
llvm::Triple::systemz
@ systemz
Definition: Triple.h:80
llvm::Triple::Myriad
@ Myriad
Definition: Triple.h:166
llvm::ARM::ISAKind::ARM
@ ARM
llvm::Triple::ARMSubArch_v8_1a
@ ARMSubArch_v8_1a
Definition: Triple.h:124
parseVersionFromName
static VersionTuple parseVersionFromName(StringRef Name)
Definition: Triple.cpp:1165
llvm::Triple::getVendorTypeName
static StringRef getVendorTypeName(VendorType Kind)
Get the canonical name for the Kind vendor.
Definition: Triple.cpp:178
llvm::Triple::isMacCatalystEnvironment
bool isMacCatalystEnvironment() const
Definition: Triple.h:508
llvm::Triple::COFF
@ COFF
Definition: Triple.h:264
llvm::Triple::spir
@ spir
Definition: Triple.h:96
llvm::Triple::setArchName
void setArchName(StringRef Str)
Set the architecture (first) component of the triple by name.
Definition: Triple.cpp:1327
Version
uint64_t Version
Definition: RawMemProfReader.cpp:40
llvm::Triple::hasEnvironment
bool hasEnvironment() const
Does this triple have the optional environment (fourth) component?
Definition: Triple.h:349
llvm::Triple::MacABI
@ MacABI
Definition: Triple.h:240
llvm::Triple::thumbeb
@ thumbeb
Definition: Triple.h:84
llvm::sys::IsLittleEndianHost
static const bool IsLittleEndianHost
Definition: SwapByteOrder.h:101
llvm::ARM::ProfileKind::M
@ M
llvm::Triple::CloudABI
@ CloudABI
Definition: Triple.h:177
llvm::Triple::getArchTypeName
static StringRef getArchTypeName(ArchType Kind)
Get the canonical name for the Kind architecture.
Definition: Triple.cpp:23
llvm::Triple::ARMSubArch_v6
@ ARMSubArch_v6
Definition: Triple.h:136
llvm::Triple::getEnvironment
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
Definition: Triple.h:354
llvm::Triple::EABIHF
@ EABIHF
Definition: Triple.h:228
llvm::Triple::getVendor
VendorType getVendor() const
Get the parsed vendor type of this triple.
Definition: Triple.h:343
llvm::StringSwitch
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:44
llvm::Triple::SUSE
@ SUSE
Definition: Triple.h:169
llvm::Triple::GNUEABIHF
@ GNUEABIHF
Definition: Triple.h:223
llvm::Triple::getBigEndianArchVariant
llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
Definition: Triple.cpp:1598
llvm::Triple::Library
@ Library
Definition: Triple.h:249
llvm::Triple::UnknownOS
@ UnknownOS
Definition: Triple.h:174
llvm::Triple::NoSubArch
@ NoSubArch
Definition: Triple.h:111
parseVendor
static Triple::VendorType parseVendor(StringRef VendorName)
Definition: Triple.cpp:527
llvm::Triple::EABI
@ EABI
Definition: Triple.h:227
llvm::Triple::wasm64
@ wasm64
Definition: Triple.h:104
llvm::Triple::getLittleEndianArchVariant
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
Definition: Triple.cpp:1664
llvm::ARM::ISAKind::AARCH64
@ AARCH64
llvm::Triple::tce
@ tce
Definition: Triple.h:81
llvm::Triple::ARMSubArch_v9_2a
@ ARMSubArch_v9_2a
Definition: Triple.h:114
llvm::Triple::mips
@ mips
Definition: Triple.h:64
llvm::Triple::aarch64
@ aarch64
Definition: Triple.h:51
llvm::Triple::setObjectFormat
void setObjectFormat(ObjectFormatType Kind)
Set the object file format.
Definition: Triple.cpp:1319
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1225
llvm::Triple::Domain
@ Domain
Definition: Triple.h:247
llvm::Triple::Apple
@ Apple
Definition: Triple.h:157
llvm::Triple::PPCSubArch_spe
@ PPCSubArch_spe
Definition: Triple.h:152
llvm::Triple::UnknownObjectFormat
@ UnknownObjectFormat
Definition: Triple.h:262
llvm::Triple::getEnvironmentName
StringRef getEnvironmentName() const
Get the optional environment (fourth) component of the triple, or "" if empty.
Definition: Triple.cpp:1154