@@ -559,6 +559,15 @@ static llvm::ArrayRef<const char *> GetCompatibleArchs(ArchSpec::Core core) {
559
559
switch (core) {
560
560
default :
561
561
LLVM_FALLTHROUGH;
562
+ case ArchSpec::eCore_arm_arm64e: {
563
+ static const char *g_arm64e_compatible_archs[] = {
564
+ " arm64e" , " arm64" , " armv7" , " armv7f" , " armv7k" , " armv7s" ,
565
+ " armv7m" , " armv7em" , " armv6m" , " armv6" , " armv5" , " armv4" ,
566
+ " arm" , " thumbv7" , " thumbv7f" , " thumbv7k" , " thumbv7s" , " thumbv7m" ,
567
+ " thumbv7em" , " thumbv6m" , " thumbv6" , " thumbv5" , " thumbv4t" , " thumb" ,
568
+ };
569
+ return {g_arm64e_compatible_archs};
570
+ }
562
571
case ArchSpec::eCore_arm_arm64: {
563
572
static const char *g_arm64_compatible_archs[] = {
564
573
" arm64" , " armv7" , " armv7f" , " armv7k" , " armv7s" , " armv7m" ,
@@ -654,38 +663,15 @@ const char *PlatformDarwin::GetCompatibleArch(ArchSpec::Core core, size_t idx) {
654
663
// / processor.
655
664
bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx,
656
665
ArchSpec &arch) {
657
- #if TARGET_OS_OSX
658
- if (IsHost ()) {
659
- if (idx == 0 ) {
660
- arch.SetTriple (" arm64e-apple-macosx" );
661
- return true ;
662
- } else if (idx == 1 ) {
663
- arch.SetTriple (" arm64-apple-macosx" );
664
- return true ;
665
- }
666
- arch.Clear ();
667
- return false ;
668
- }
669
- #endif
670
-
671
- #if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
672
- #define OSNAME " tvos"
673
- #elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
674
- #define OSNAME " watchos"
675
- #elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
676
- #define OSNAME " bridgeos"
677
- #elif defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1
678
- #define OSNAME " macosx"
679
- #else
680
- #define OSNAME " ios"
681
- #endif
682
-
683
666
const ArchSpec system_arch = GetSystemArchitecture ();
684
667
const ArchSpec::Core system_core = system_arch.GetCore ();
668
+
685
669
if (const char *compatible_arch = GetCompatibleArch (system_core, idx)) {
686
- std::string triple =
687
- llvm::formatv (" {0}-apple-" OSNAME, compatible_arch).str ();
670
+ llvm::Triple triple;
671
+ triple.setArchName (compatible_arch);
672
+ triple.setVendor (llvm::Triple::VendorType::Apple);
688
673
arch.SetTriple (triple);
674
+ return true ;
689
675
}
690
676
691
677
arch.Clear ();
0 commit comments