forked from OSchip/llvm-project
Add code to PlatformDarwin and HostInfoMacOSX so they return the
correct OS type when running on an apple tv or apple watch. Also, in TargetList::CreateTargetInternal, check that a platform is returned by GetPlatformForArchitecture fallback instead of adding it to the vector of platforms unconditionally; we can end up crashing when we call a member function on it later. <rdar://problem/23601982>, <rdar://problem/21292886> llvm-svn: 253763
This commit is contained in:
parent
16e2a9eeb6
commit
e92a74ce64
|
@ -45,6 +45,8 @@
|
|||
#define CPU_TYPE_ARM64 (CPU_TYPE_ARM|CPU_ARCH_ABI64)
|
||||
#endif
|
||||
|
||||
#include <TargetConditionals.h> // for TARGET_OS_TV, TARGET_OS_WATCH
|
||||
|
||||
using namespace lldb_private;
|
||||
|
||||
bool
|
||||
|
@ -340,8 +342,14 @@ HostInfoMacOSX::ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch
|
|||
|
||||
if (cputype == CPU_TYPE_ARM || cputype == CPU_TYPE_ARM64)
|
||||
{
|
||||
// When running on a watch or tv, report the host os correctly
|
||||
#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1
|
||||
arch_32.GetTriple().setOS(llvm::Triple::TvOS);
|
||||
arch_64.GetTriple().setOS(llvm::Triple::TvOS);
|
||||
#else
|
||||
arch_32.GetTriple().setOS(llvm::Triple::IOS);
|
||||
arch_64.GetTriple().setOS(llvm::Triple::IOS);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -353,6 +361,11 @@ HostInfoMacOSX::ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch
|
|||
{
|
||||
// We have a 32 bit kernel on a 32 bit system
|
||||
arch_32.SetArchitecture(eArchTypeMachO, cputype, cpusubtype);
|
||||
#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
|
||||
arch_32.GetTriple().setOS(llvm::Triple::WatchOS);
|
||||
#else
|
||||
arch_32.GetTriple().setOS(llvm::Triple::IOS);
|
||||
#endif
|
||||
arch_64.Clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,10 @@
|
|||
#include "lldb/Target/Target.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
|
||||
#if defined (__APPLE__)
|
||||
#include <TargetConditionals.h> // for TARGET_OS_TV, TARGET_OS_WATCH
|
||||
#endif
|
||||
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
|
@ -761,35 +765,44 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
{
|
||||
ArchSpec system_arch (GetSystemArchitecture());
|
||||
|
||||
// When lldb is running on a watch or tv, set the arch OS name appropriately.
|
||||
#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1
|
||||
#define OSNAME "tvos"
|
||||
#elif defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
|
||||
#define OSNAME "watchos"
|
||||
#else
|
||||
#define OSNAME "ios"
|
||||
#endif
|
||||
|
||||
const ArchSpec::Core system_core = system_arch.GetCore();
|
||||
switch (system_core)
|
||||
{
|
||||
default:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("arm64-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv7f-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv7k-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv7s-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("armv7m-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("armv7em-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 12: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 13: arch.SetTriple ("thumbv7f-apple-ios"); return true;
|
||||
case 14: arch.SetTriple ("thumbv7k-apple-ios"); return true;
|
||||
case 15: arch.SetTriple ("thumbv7s-apple-ios"); return true;
|
||||
case 16: arch.SetTriple ("thumbv7m-apple-ios"); return true;
|
||||
case 17: arch.SetTriple ("thumbv7em-apple-ios"); return true;
|
||||
case 18: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 19: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 20: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 21: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 22: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("arm64-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv7f-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv7k-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv7s-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("armv7m-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("armv7em-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 12: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 13: arch.SetTriple ("thumbv7f-apple-" OSNAME); return true;
|
||||
case 14: arch.SetTriple ("thumbv7k-apple-" OSNAME); return true;
|
||||
case 15: arch.SetTriple ("thumbv7s-apple-" OSNAME); return true;
|
||||
case 16: arch.SetTriple ("thumbv7m-apple-" OSNAME); return true;
|
||||
case 17: arch.SetTriple ("thumbv7em-apple-" OSNAME); return true;
|
||||
case 18: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 19: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 20: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 21: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 22: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -797,28 +810,28 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_arm64:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("arm64-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv7s-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv7f-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv7m-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv7em-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 12: arch.SetTriple ("thumbv7f-apple-ios"); return true;
|
||||
case 13: arch.SetTriple ("thumbv7k-apple-ios"); return true;
|
||||
case 14: arch.SetTriple ("thumbv7s-apple-ios"); return true;
|
||||
case 15: arch.SetTriple ("thumbv7m-apple-ios"); return true;
|
||||
case 16: arch.SetTriple ("thumbv7em-apple-ios"); return true;
|
||||
case 17: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 18: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 19: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 20: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 21: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("arm64-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv7s-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv7f-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv7m-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv7em-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 12: arch.SetTriple ("thumbv7f-apple-" OSNAME); return true;
|
||||
case 13: arch.SetTriple ("thumbv7k-apple-" OSNAME); return true;
|
||||
case 14: arch.SetTriple ("thumbv7s-apple-" OSNAME); return true;
|
||||
case 15: arch.SetTriple ("thumbv7m-apple-" OSNAME); return true;
|
||||
case 16: arch.SetTriple ("thumbv7em-apple-" OSNAME); return true;
|
||||
case 17: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 18: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 19: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 20: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 21: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -826,20 +839,20 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv7f:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv7f-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumbv7f-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv7f-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumbv7f-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -847,20 +860,20 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv7k:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv7k-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumbv7k-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv7k-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumbv7k-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -868,20 +881,20 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv7s:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv7s-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumbv7s-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv7s-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumbv7s-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -889,20 +902,20 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv7m:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv7m-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumbv7m-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv7m-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumbv7m-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -910,20 +923,20 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv7em:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv7em-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumbv7em-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv7em-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumbv7em-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 12: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 13: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -931,18 +944,18 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv7:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv7-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("thumbv7-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 10: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 11: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv7-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("thumbv7-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 10: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 11: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -950,16 +963,16 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv6m:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv6m-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("thumbv6m-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 8: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 9: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv6m-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("thumbv6m-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 8: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 9: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -967,14 +980,14 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv6:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv6-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("thumbv6-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 6: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 7: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv6-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("thumbv6-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 6: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 7: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -982,12 +995,12 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv5:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv5-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("thumbv5-apple-ios"); return true;
|
||||
case 4: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 5: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv5-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("thumbv5-apple-" OSNAME); return true;
|
||||
case 4: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 5: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -995,10 +1008,10 @@ PlatformDarwin::ARMGetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch
|
|||
case ArchSpec::eCore_arm_armv4:
|
||||
switch (idx)
|
||||
{
|
||||
case 0: arch.SetTriple ("armv4-apple-ios"); return true;
|
||||
case 1: arch.SetTriple ("arm-apple-ios"); return true;
|
||||
case 2: arch.SetTriple ("thumbv4t-apple-ios"); return true;
|
||||
case 3: arch.SetTriple ("thumb-apple-ios"); return true;
|
||||
case 0: arch.SetTriple ("armv4-apple-" OSNAME); return true;
|
||||
case 1: arch.SetTriple ("arm-apple-" OSNAME); return true;
|
||||
case 2: arch.SetTriple ("thumbv4t-apple-" OSNAME); return true;
|
||||
case 3: arch.SetTriple ("thumb-apple-" OSNAME); return true;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -245,7 +245,11 @@ TargetList::CreateTargetInternal (Debugger &debugger,
|
|||
}
|
||||
|
||||
// Just find a platform that matches the architecture in the executable file
|
||||
platforms.push_back(Platform::GetPlatformForArchitecture(module_spec.GetArchitecture(), nullptr));
|
||||
PlatformSP fallback_platform_sp (Platform::GetPlatformForArchitecture(module_spec.GetArchitecture(), nullptr));
|
||||
if (fallback_platform_sp)
|
||||
{
|
||||
platforms.push_back(fallback_platform_sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue