1 //===--- Triple.cpp - Target triple helper class --------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/ADT/Triple.h"
11 #include "llvm/ADT/SmallString.h"
12 #include "llvm/ADT/StringSwitch.h"
13 #include "llvm/ADT/STLExtras.h"
14 #include "llvm/Support/ErrorHandling.h"
18 const char *Triple::getArchTypeName(ArchType Kind) {
20 case UnknownArch: return "unknown";
22 case arm: return "arm";
23 case cellspu: return "cellspu";
24 case hexagon: return "hexagon";
25 case mips: return "mips";
26 case mipsel: return "mipsel";
27 case mips64: return "mips64";
28 case mips64el:return "mips64el";
29 case msp430: return "msp430";
30 case ppc64: return "powerpc64";
31 case ppc: return "powerpc";
32 case r600: return "r600";
33 case sparc: return "sparc";
34 case sparcv9: return "sparcv9";
35 case tce: return "tce";
36 case thumb: return "thumb";
37 case x86: return "i386";
38 case x86_64: return "x86_64";
39 case xcore: return "xcore";
40 case mblaze: return "mblaze";
41 case ptx32: return "ptx32";
42 case ptx64: return "ptx64";
43 case nvptx: return "nvptx";
44 case nvptx64: return "nvptx64";
45 case le32: return "le32";
46 case amdil: return "amdil";
49 llvm_unreachable("Invalid ArchType!");
52 const char *Triple::getArchTypePrefix(ArchType Kind) {
58 case thumb: return "arm";
60 case cellspu: return "spu";
63 case ppc: return "ppc";
65 case mblaze: return "mblaze";
67 case hexagon: return "hexagon";
69 case r600: return "r600";
72 case sparc: return "sparc";
75 case x86_64: return "x86";
77 case xcore: return "xcore";
79 case ptx32: return "ptx";
80 case ptx64: return "ptx";
81 case nvptx: return "nvptx";
82 case nvptx64: return "nvptx";
83 case le32: return "le32";
84 case amdil: return "amdil";
88 const char *Triple::getVendorTypeName(VendorType Kind) {
90 case UnknownVendor: return "unknown";
92 case Apple: return "apple";
94 case SCEI: return "scei";
95 case BGP: return "bgp";
96 case BGQ: return "bgq";
99 llvm_unreachable("Invalid VendorType!");
102 const char *Triple::getOSTypeName(OSType Kind) {
104 case UnknownOS: return "unknown";
106 case AuroraUX: return "auroraux";
107 case Cygwin: return "cygwin";
108 case Darwin: return "darwin";
109 case DragonFly: return "dragonfly";
110 case FreeBSD: return "freebsd";
111 case IOS: return "ios";
112 case KFreeBSD: return "kfreebsd";
113 case Linux: return "linux";
114 case Lv2: return "lv2";
115 case MacOSX: return "macosx";
116 case MinGW32: return "mingw32";
117 case NetBSD: return "netbsd";
118 case OpenBSD: return "openbsd";
119 case Solaris: return "solaris";
120 case Win32: return "win32";
121 case Haiku: return "haiku";
122 case Minix: return "minix";
123 case RTEMS: return "rtems";
124 case NativeClient: return "nacl";
125 case CNK: return "cnk";
128 llvm_unreachable("Invalid OSType");
131 const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
133 case UnknownEnvironment: return "unknown";
134 case GNU: return "gnu";
135 case GNUEABIHF: return "gnueabihf";
136 case GNUEABI: return "gnueabi";
137 case EABI: return "eabi";
138 case MachO: return "macho";
139 case ANDROIDEABI: return "androideabi";
142 llvm_unreachable("Invalid EnvironmentType!");
145 Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
146 return StringSwitch<Triple::ArchType>(Name)
148 .Case("cellspu", cellspu)
150 .Case("mipsel", mipsel)
151 .Case("mips64", mips64)
152 .Case("mips64el", mips64el)
153 .Case("msp430", msp430)
154 .Case("ppc64", ppc64)
157 .Case("mblaze", mblaze)
159 .Case("hexagon", hexagon)
160 .Case("sparc", sparc)
161 .Case("sparcv9", sparcv9)
163 .Case("thumb", thumb)
165 .Case("x86-64", x86_64)
166 .Case("xcore", xcore)
167 .Case("ptx32", ptx32)
168 .Case("ptx64", ptx64)
169 .Case("nvptx", nvptx)
170 .Case("nvptx64", nvptx64)
172 .Case("amdil", amdil)
173 .Default(UnknownArch);
176 Triple::ArchType Triple::getArchTypeForDarwinArchName(StringRef Str) {
177 // See arch(3) and llvm-gcc's driver-driver.c. We don't implement support for
178 // archs which Darwin doesn't use.
180 // The matching this routine does is fairly pointless, since it is neither the
181 // complete architecture list, nor a reasonable subset. The problem is that
182 // historically the driver driver accepts this and also ties its -march=
183 // handling to the architecture name, so we need to be careful before removing
186 // This code must be kept in sync with Clang's Darwin specific argument
189 return StringSwitch<ArchType>(Str)
190 .Cases("ppc", "ppc601", "ppc603", "ppc604", "ppc604e", Triple::ppc)
191 .Cases("ppc750", "ppc7400", "ppc7450", "ppc970", Triple::ppc)
192 .Case("ppc64", Triple::ppc64)
193 .Cases("i386", "i486", "i486SX", "i586", "i686", Triple::x86)
194 .Cases("pentium", "pentpro", "pentIIm3", "pentIIm5", "pentium4",
196 .Case("x86_64", Triple::x86_64)
197 // This is derived from the driver driver.
198 .Cases("arm", "armv4t", "armv5", "armv6", Triple::arm)
199 .Cases("armv7", "armv7f", "armv7k", "armv7s", "xscale", Triple::arm)
200 .Case("r600", Triple::r600)
201 .Case("ptx32", Triple::ptx32)
202 .Case("ptx64", Triple::ptx64)
203 .Case("nvptx", Triple::nvptx)
204 .Case("nvptx64", Triple::nvptx64)
205 .Case("amdil", Triple::amdil)
206 .Default(Triple::UnknownArch);
209 // Returns architecture name that is understood by the target assembler.
210 const char *Triple::getArchNameForAssembler() {
211 if (!isOSDarwin() && getVendor() != Triple::Apple)
214 return StringSwitch<const char*>(getArchName())
215 .Case("i386", "i386")
216 .Case("x86_64", "x86_64")
217 .Case("powerpc", "ppc")
218 .Case("powerpc64", "ppc64")
219 .Cases("mblaze", "microblaze", "mblaze")
221 .Cases("armv4t", "thumbv4t", "armv4t")
222 .Cases("armv5", "armv5e", "thumbv5", "thumbv5e", "armv5")
223 .Cases("armv6", "thumbv6", "armv6")
224 .Cases("armv7", "thumbv7", "armv7")
225 .Case("r600", "r600")
226 .Case("ptx32", "ptx32")
227 .Case("ptx64", "ptx64")
228 .Case("nvptx", "nvptx")
229 .Case("nvptx64", "nvptx64")
230 .Case("le32", "le32")
231 .Case("amdil", "amdil")
235 static Triple::ArchType parseArch(StringRef ArchName) {
236 return StringSwitch<Triple::ArchType>(ArchName)
237 .Cases("i386", "i486", "i586", "i686", Triple::x86)
238 // FIXME: Do we need to support these?
239 .Cases("i786", "i886", "i986", Triple::x86)
240 .Cases("amd64", "x86_64", Triple::x86_64)
241 .Case("powerpc", Triple::ppc)
242 .Cases("powerpc64", "ppu", Triple::ppc64)
243 .Case("mblaze", Triple::mblaze)
244 .Cases("arm", "xscale", Triple::arm)
245 // FIXME: It would be good to replace these with explicit names for all the
246 // various suffixes supported.
247 .StartsWith("armv", Triple::arm)
248 .Case("thumb", Triple::thumb)
249 .StartsWith("thumbv", Triple::thumb)
250 .Cases("spu", "cellspu", Triple::cellspu)
251 .Case("msp430", Triple::msp430)
252 .Cases("mips", "mipseb", "mipsallegrex", Triple::mips)
253 .Cases("mipsel", "mipsallegrexel", Triple::mipsel)
254 .Cases("mips64", "mips64eb", Triple::mips64)
255 .Case("mips64el", Triple::mips64el)
256 .Case("r600", Triple::r600)
257 .Case("hexagon", Triple::hexagon)
258 .Case("sparc", Triple::sparc)
259 .Case("sparcv9", Triple::sparcv9)
260 .Case("tce", Triple::tce)
261 .Case("xcore", Triple::xcore)
262 .Case("ptx32", Triple::ptx32)
263 .Case("ptx64", Triple::ptx64)
264 .Case("nvptx", Triple::nvptx)
265 .Case("nvptx64", Triple::nvptx64)
266 .Case("le32", Triple::le32)
267 .Case("amdil", Triple::amdil)
268 .Default(Triple::UnknownArch);
271 static Triple::VendorType parseVendor(StringRef VendorName) {
272 return StringSwitch<Triple::VendorType>(VendorName)
273 .Case("apple", Triple::Apple)
274 .Case("pc", Triple::PC)
275 .Case("scei", Triple::SCEI)
276 .Case("bgp", Triple::BGP)
277 .Case("bgq", Triple::BGQ)
278 .Default(Triple::UnknownVendor);
281 static Triple::OSType parseOS(StringRef OSName) {
282 return StringSwitch<Triple::OSType>(OSName)
283 .StartsWith("auroraux", Triple::AuroraUX)
284 .StartsWith("cygwin", Triple::Cygwin)
285 .StartsWith("darwin", Triple::Darwin)
286 .StartsWith("dragonfly", Triple::DragonFly)
287 .StartsWith("freebsd", Triple::FreeBSD)
288 .StartsWith("ios", Triple::IOS)
289 .StartsWith("kfreebsd", Triple::KFreeBSD)
290 .StartsWith("linux", Triple::Linux)
291 .StartsWith("lv2", Triple::Lv2)
292 .StartsWith("macosx", Triple::MacOSX)
293 .StartsWith("mingw32", Triple::MinGW32)
294 .StartsWith("netbsd", Triple::NetBSD)
295 .StartsWith("openbsd", Triple::OpenBSD)
296 .StartsWith("solaris", Triple::Solaris)
297 .StartsWith("win32", Triple::Win32)
298 .StartsWith("haiku", Triple::Haiku)
299 .StartsWith("minix", Triple::Minix)
300 .StartsWith("rtems", Triple::RTEMS)
301 .StartsWith("nacl", Triple::NativeClient)
302 .StartsWith("cnk", Triple::CNK)
303 .Default(Triple::UnknownOS);
306 static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
307 return StringSwitch<Triple::EnvironmentType>(EnvironmentName)
308 .StartsWith("eabi", Triple::EABI)
309 .StartsWith("gnueabihf", Triple::GNUEABIHF)
310 .StartsWith("gnueabi", Triple::GNUEABI)
311 .StartsWith("gnu", Triple::GNU)
312 .StartsWith("macho", Triple::MachO)
313 .StartsWith("androideabi", Triple::ANDROIDEABI)
314 .Default(Triple::UnknownEnvironment);
317 /// \brief Construct a triple from the string representation provided.
319 /// This stores the string representation and parses the various pieces into
321 Triple::Triple(const Twine &Str)
323 Arch(parseArch(getArchName())),
324 Vendor(parseVendor(getVendorName())),
325 OS(parseOS(getOSName())),
326 Environment(parseEnvironment(getEnvironmentName())) {
329 /// \brief Construct a triple from string representations of the architecture,
332 /// This joins each argument into a canonical string representation and parses
333 /// them into enum members. It leaves the environment unknown and omits it from
334 /// the string representation.
335 Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr)
336 : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr).str()),
337 Arch(parseArch(ArchStr.str())),
338 Vendor(parseVendor(VendorStr.str())),
339 OS(parseOS(OSStr.str())),
343 /// \brief Construct a triple from string representations of the architecture,
344 /// vendor, OS, and environment.
346 /// This joins each argument into a canonical string representation and parses
347 /// them into enum members.
348 Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
349 const Twine &EnvironmentStr)
350 : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr + Twine('-') +
351 EnvironmentStr).str()),
352 Arch(parseArch(ArchStr.str())),
353 Vendor(parseVendor(VendorStr.str())),
354 OS(parseOS(OSStr.str())),
355 Environment(parseEnvironment(EnvironmentStr.str())) {
358 std::string Triple::normalize(StringRef Str) {
359 // Parse into components.
360 SmallVector<StringRef, 4> Components;
361 Str.split(Components, "-");
363 // If the first component corresponds to a known architecture, preferentially
364 // use it for the architecture. If the second component corresponds to a
365 // known vendor, preferentially use it for the vendor, etc. This avoids silly
366 // component movement when a component parses as (eg) both a valid arch and a
368 ArchType Arch = UnknownArch;
369 if (Components.size() > 0)
370 Arch = parseArch(Components[0]);
371 VendorType Vendor = UnknownVendor;
372 if (Components.size() > 1)
373 Vendor = parseVendor(Components[1]);
374 OSType OS = UnknownOS;
375 if (Components.size() > 2)
376 OS = parseOS(Components[2]);
377 EnvironmentType Environment = UnknownEnvironment;
378 if (Components.size() > 3)
379 Environment = parseEnvironment(Components[3]);
381 // Note which components are already in their final position. These will not
384 Found[0] = Arch != UnknownArch;
385 Found[1] = Vendor != UnknownVendor;
386 Found[2] = OS != UnknownOS;
387 Found[3] = Environment != UnknownEnvironment;
389 // If they are not there already, permute the components into their canonical
390 // positions by seeing if they parse as a valid architecture, and if so moving
391 // the component to the architecture position etc.
392 for (unsigned Pos = 0; Pos != array_lengthof(Found); ++Pos) {
394 continue; // Already in the canonical position.
396 for (unsigned Idx = 0; Idx != Components.size(); ++Idx) {
397 // Do not reparse any components that already matched.
398 if (Idx < array_lengthof(Found) && Found[Idx])
401 // Does this component parse as valid for the target position?
403 StringRef Comp = Components[Idx];
405 default: llvm_unreachable("unexpected component type!");
407 Arch = parseArch(Comp);
408 Valid = Arch != UnknownArch;
411 Vendor = parseVendor(Comp);
412 Valid = Vendor != UnknownVendor;
416 Valid = OS != UnknownOS;
419 Environment = parseEnvironment(Comp);
420 Valid = Environment != UnknownEnvironment;
424 continue; // Nope, try the next component.
426 // Move the component to the target position, pushing any non-fixed
427 // components that are in the way to the right. This tends to give
428 // good results in the common cases of a forgotten vendor component
429 // or a wrongly positioned environment.
431 // Insert left, pushing the existing components to the right. For
432 // example, a-b-i386 -> i386-a-b when moving i386 to the front.
433 StringRef CurrentComponent(""); // The empty component.
434 // Replace the component we are moving with an empty component.
435 std::swap(CurrentComponent, Components[Idx]);
436 // Insert the component being moved at Pos, displacing any existing
437 // components to the right.
438 for (unsigned i = Pos; !CurrentComponent.empty(); ++i) {
439 // Skip over any fixed components.
440 while (i < array_lengthof(Found) && Found[i])
442 // Place the component at the new position, getting the component
443 // that was at this position - it will be moved right.
444 std::swap(CurrentComponent, Components[i]);
446 } else if (Pos > Idx) {
447 // Push right by inserting empty components until the component at Idx
448 // reaches the target position Pos. For example, pc-a -> -pc-a when
449 // moving pc to the second position.
451 // Insert one empty component at Idx.
452 StringRef CurrentComponent(""); // The empty component.
453 for (unsigned i = Idx; i < Components.size();) {
454 // Place the component at the new position, getting the component
455 // that was at this position - it will be moved right.
456 std::swap(CurrentComponent, Components[i]);
457 // If it was placed on top of an empty component then we are done.
458 if (CurrentComponent.empty())
460 // Advance to the next component, skipping any fixed components.
461 while (++i < array_lengthof(Found) && Found[i])
464 // The last component was pushed off the end - append it.
465 if (!CurrentComponent.empty())
466 Components.push_back(CurrentComponent);
468 // Advance Idx to the component's new position.
469 while (++Idx < array_lengthof(Found) && Found[Idx])
471 } while (Idx < Pos); // Add more until the final position is reached.
473 assert(Pos < Components.size() && Components[Pos] == Comp &&
474 "Component moved wrong!");
480 // Special case logic goes here. At this point Arch, Vendor and OS have the
481 // correct values for the computed components.
483 // Stick the corrected components back together to form the normalized string.
484 std::string Normalized;
485 for (unsigned i = 0, e = Components.size(); i != e; ++i) {
486 if (i) Normalized += '-';
487 Normalized += Components[i];
492 StringRef Triple::getArchName() const {
493 return StringRef(Data).split('-').first; // Isolate first component
496 StringRef Triple::getVendorName() const {
497 StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
498 return Tmp.split('-').first; // Isolate second component
501 StringRef Triple::getOSName() const {
502 StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
503 Tmp = Tmp.split('-').second; // Strip second component
504 return Tmp.split('-').first; // Isolate third component
507 StringRef Triple::getEnvironmentName() const {
508 StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
509 Tmp = Tmp.split('-').second; // Strip second component
510 return Tmp.split('-').second; // Strip third component
513 StringRef Triple::getOSAndEnvironmentName() const {
514 StringRef Tmp = StringRef(Data).split('-').second; // Strip first component
515 return Tmp.split('-').second; // Strip second component
518 static unsigned EatNumber(StringRef &Str) {
519 assert(!Str.empty() && Str[0] >= '0' && Str[0] <= '9' && "Not a number");
523 // Consume the leading digit.
524 Result = Result*10 + (Str[0] - '0');
528 } while (!Str.empty() && Str[0] >= '0' && Str[0] <= '9');
533 void Triple::getOSVersion(unsigned &Major, unsigned &Minor,
534 unsigned &Micro) const {
535 StringRef OSName = getOSName();
537 // Assume that the OS portion of the triple starts with the canonical name.
538 StringRef OSTypeName = getOSTypeName(getOS());
539 if (OSName.startswith(OSTypeName))
540 OSName = OSName.substr(OSTypeName.size());
542 // Any unset version defaults to 0.
543 Major = Minor = Micro = 0;
545 // Parse up to three components.
546 unsigned *Components[3] = { &Major, &Minor, &Micro };
547 for (unsigned i = 0; i != 3; ++i) {
548 if (OSName.empty() || OSName[0] < '0' || OSName[0] > '9')
551 // Consume the leading number.
552 *Components[i] = EatNumber(OSName);
554 // Consume the separator, if present.
555 if (OSName.startswith("."))
556 OSName = OSName.substr(1);
560 bool Triple::getMacOSXVersion(unsigned &Major, unsigned &Minor,
561 unsigned &Micro) const {
562 getOSVersion(Major, Minor, Micro);
565 default: llvm_unreachable("unexpected OS for Darwin triple");
567 // Default to darwin8, i.e., MacOSX 10.4.
570 // Darwin version numbers are skewed from OS X versions.
587 // Ignore the version from the triple. This is only handled because the
588 // the clang driver combines OS X and IOS support into a common Darwin
589 // toolchain that wants to know the OS X version number even when targeting
599 void Triple::getiOSVersion(unsigned &Major, unsigned &Minor,
600 unsigned &Micro) const {
602 default: llvm_unreachable("unexpected OS for Darwin triple");
605 // Ignore the version from the triple. This is only handled because the
606 // the clang driver combines OS X and IOS support into a common Darwin
607 // toolchain that wants to know the iOS version number even when targeting
614 getOSVersion(Major, Minor, Micro);
622 void Triple::setTriple(const Twine &Str) {
626 void Triple::setArch(ArchType Kind) {
627 setArchName(getArchTypeName(Kind));
630 void Triple::setVendor(VendorType Kind) {
631 setVendorName(getVendorTypeName(Kind));
634 void Triple::setOS(OSType Kind) {
635 setOSName(getOSTypeName(Kind));
638 void Triple::setEnvironment(EnvironmentType Kind) {
639 setEnvironmentName(getEnvironmentTypeName(Kind));
642 void Triple::setArchName(StringRef Str) {
643 // Work around a miscompilation bug for Twines in gcc 4.0.3.
644 SmallString<64> Triple;
647 Triple += getVendorName();
649 Triple += getOSAndEnvironmentName();
650 setTriple(Triple.str());
653 void Triple::setVendorName(StringRef Str) {
654 setTriple(getArchName() + "-" + Str + "-" + getOSAndEnvironmentName());
657 void Triple::setOSName(StringRef Str) {
658 if (hasEnvironment())
659 setTriple(getArchName() + "-" + getVendorName() + "-" + Str +
660 "-" + getEnvironmentName());
662 setTriple(getArchName() + "-" + getVendorName() + "-" + Str);
665 void Triple::setEnvironmentName(StringRef Str) {
666 setTriple(getArchName() + "-" + getVendorName() + "-" + getOSName() +
670 void Triple::setOSAndEnvironmentName(StringRef Str) {
671 setTriple(getArchName() + "-" + getVendorName() + "-" + Str);
674 static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
676 case llvm::Triple::UnknownArch:
679 case llvm::Triple::msp430:
682 case llvm::Triple::amdil:
683 case llvm::Triple::arm:
684 case llvm::Triple::cellspu:
685 case llvm::Triple::hexagon:
686 case llvm::Triple::le32:
687 case llvm::Triple::mblaze:
688 case llvm::Triple::mips:
689 case llvm::Triple::mipsel:
690 case llvm::Triple::nvptx:
691 case llvm::Triple::ppc:
692 case llvm::Triple::ptx32:
693 case llvm::Triple::r600:
694 case llvm::Triple::sparc:
695 case llvm::Triple::tce:
696 case llvm::Triple::thumb:
697 case llvm::Triple::x86:
698 case llvm::Triple::xcore:
701 case llvm::Triple::mips64:
702 case llvm::Triple::mips64el:
703 case llvm::Triple::nvptx64:
704 case llvm::Triple::ppc64:
705 case llvm::Triple::ptx64:
706 case llvm::Triple::sparcv9:
707 case llvm::Triple::x86_64:
710 llvm_unreachable("Invalid architecture value");
713 bool Triple::isArch64Bit() const {
714 return getArchPointerBitWidth(getArch()) == 64;
717 bool Triple::isArch32Bit() const {
718 return getArchPointerBitWidth(getArch()) == 32;
721 bool Triple::isArch16Bit() const {
722 return getArchPointerBitWidth(getArch()) == 16;
725 Triple Triple::get32BitArchVariant() const {
728 case Triple::UnknownArch:
730 T.setArch(UnknownArch);
735 case Triple::cellspu:
736 case Triple::hexagon:
753 case Triple::mips64: T.setArch(Triple::mips); break;
754 case Triple::mips64el: T.setArch(Triple::mipsel); break;
755 case Triple::nvptx64: T.setArch(Triple::nvptx); break;
756 case Triple::ppc64: T.setArch(Triple::ppc); break;
757 case Triple::ptx64: T.setArch(Triple::ptx32); break;
758 case Triple::sparcv9: T.setArch(Triple::sparc); break;
759 case Triple::x86_64: T.setArch(Triple::x86); break;
764 Triple Triple::get64BitArchVariant() const {
767 case Triple::UnknownArch:
770 case Triple::cellspu:
771 case Triple::hexagon:
779 T.setArch(UnknownArch);
783 case Triple::mips64el:
784 case Triple::nvptx64:
787 case Triple::sparcv9:
792 case Triple::mips: T.setArch(Triple::mips64); break;
793 case Triple::mipsel: T.setArch(Triple::mips64el); break;
794 case Triple::nvptx: T.setArch(Triple::nvptx64); break;
795 case Triple::ppc: T.setArch(Triple::ppc64); break;
796 case Triple::ptx32: T.setArch(Triple::ptx64); break;
797 case Triple::sparc: T.setArch(Triple::sparcv9); break;
798 case Triple::x86: T.setArch(Triple::x86_64); break;