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