@@ -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" ,
@@ -662,38 +671,15 @@ const char *PlatformDarwin::GetCompatibleArch(ArchSpec::Core core, size_t idx) {
662
671
// / processor.
663
672
bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx,
664
673
ArchSpec &arch) {
665
- #if TARGET_OS_OSX
666
- if (IsHost ()) {
667
- if (idx == 0 ) {
668
- arch.SetTriple (" arm64e-apple-macosx" );
669
- return true ;
670
- } else if (idx == 1 ) {
671
- arch.SetTriple (" arm64-apple-macosx" );
672
- return true ;
673
- }
674
- arch.Clear ();
675
- return false ;
676
- }
677
- #endif
678
-
679
- #if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
680
- #define OSNAME " tvos"
681
- #elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
682
- #define OSNAME " watchos"
683
- #elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
684
- #define OSNAME " bridgeos"
685
- #elif defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1
686
- #define OSNAME " macosx"
687
- #else
688
- #define OSNAME " ios"
689
- #endif
690
-
691
674
const ArchSpec system_arch = GetSystemArchitecture ();
692
675
const ArchSpec::Core system_core = system_arch.GetCore ();
676
+
693
677
if (const char *compatible_arch = GetCompatibleArch (system_core, idx)) {
694
- std::string triple =
695
- llvm::formatv (" {0}-apple-" OSNAME, compatible_arch).str ();
678
+ llvm::Triple triple;
679
+ triple.setArchName (compatible_arch);
680
+ triple.setVendor (llvm::Triple::VendorType::Apple);
696
681
arch.SetTriple (triple);
682
+ return true ;
697
683
}
698
684
699
685
arch.Clear ();
0 commit comments