Since ABI's now hold a process WP, they should be handed

out one per process rather than keeping a single global instance.

Differential Revision: https://reviews.llvm.org/D54460

llvm-svn: 346775
This commit is contained in:
Jim Ingham 2018-11-13 18:18:32 +00:00
parent cbde0d9c7b
commit 7716ddf18d
12 changed files with 12 additions and 48 deletions

View File

@ -1323,16 +1323,13 @@ size_t ABIMacOSX_arm::GetRedZoneSize() const { return 0; }
ABISP
ABIMacOSX_arm::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
if (vendor_type == llvm::Triple::Apple) {
if ((arch_type == llvm::Triple::arm) ||
(arch_type == llvm::Triple::thumb)) {
if (!g_abi_sp)
g_abi_sp.reset(new ABIMacOSX_arm(process_sp));
return g_abi_sp;
return ABISP(new ABIMacOSX_arm(process_sp));
}
}

View File

@ -1664,15 +1664,12 @@ size_t ABIMacOSX_arm64::GetRedZoneSize() const { return 128; }
ABISP
ABIMacOSX_arm64::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
if (vendor_type == llvm::Triple::Apple) {
if (arch_type == llvm::Triple::aarch64) {
if (!g_abi_sp)
g_abi_sp.reset(new ABIMacOSX_arm64(process_sp));
return g_abi_sp;
return ABISP(new ABIMacOSX_arm64(process_sp));
}
}

View File

@ -710,13 +710,10 @@ size_t ABIMacOSX_i386::GetRedZoneSize() const { return 0; }
ABISP
ABIMacOSX_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
if ((arch.GetTriple().getArch() == llvm::Triple::x86) &&
(arch.GetTriple().isMacOSX() || arch.GetTriple().isiOS() ||
arch.GetTriple().isWatchOS())) {
if (!g_abi_sp)
g_abi_sp.reset(new ABIMacOSX_i386(process_sp));
return g_abi_sp;
return ABISP(new ABIMacOSX_i386(process_sp));
}
return ABISP();
}

View File

@ -1324,16 +1324,13 @@ size_t ABISysV_arm::GetRedZoneSize() const { return 0; }
ABISP
ABISysV_arm::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
if (vendor_type != llvm::Triple::Apple) {
if ((arch_type == llvm::Triple::arm) ||
(arch_type == llvm::Triple::thumb)) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_arm(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_arm(process_sp));
}
}

View File

@ -1667,15 +1667,12 @@ size_t ABISysV_arm64::GetRedZoneSize() const { return 128; }
ABISP
ABISysV_arm64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
if (vendor_type != llvm::Triple::Apple) {
if (arch_type == llvm::Triple::aarch64) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_arm64(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_arm64(process_sp));
}
}

View File

@ -1016,11 +1016,8 @@ size_t ABISysV_hexagon::GetRedZoneSize() const { return 0; }
ABISP
ABISysV_hexagon::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
if (arch.GetTriple().getArch() == llvm::Triple::hexagon) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_hexagon(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_hexagon(process_sp));
}
return ABISP();
}

View File

@ -199,12 +199,9 @@ ABISysV_i386::GetRegisterInfoArray(uint32_t &count) {
ABISP
ABISysV_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
if (arch.GetTriple().getVendor() != llvm::Triple::Apple) {
if (arch.GetTriple().getArch() == llvm::Triple::x86) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_i386(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_i386(process_sp));
}
}
return ABISP();

View File

@ -556,13 +556,10 @@ size_t ABISysV_mips::GetRedZoneSize() const { return 0; }
ABISP
ABISysV_mips::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
if ((arch_type == llvm::Triple::mips) ||
(arch_type == llvm::Triple::mipsel)) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_mips(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_mips(process_sp));
}
return ABISP();
}

View File

@ -556,13 +556,10 @@ size_t ABISysV_mips64::GetRedZoneSize() const { return 0; }
ABISP
ABISysV_mips64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
if ((arch_type == llvm::Triple::mips64) ||
(arch_type == llvm::Triple::mips64el)) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_mips64(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_mips64(process_sp));
}
return ABISP();
}

View File

@ -220,11 +220,8 @@ size_t ABISysV_ppc::GetRedZoneSize() const { return 224; }
ABISP
ABISysV_ppc::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
if (arch.GetTriple().getArch() == llvm::Triple::ppc) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_ppc(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_ppc(process_sp));
}
return ABISP();
}

View File

@ -202,11 +202,8 @@ size_t ABISysV_s390x::GetRedZoneSize() const { return 0; }
ABISP
ABISysV_s390x::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
if (arch.GetTriple().getArch() == llvm::Triple::systemz) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_s390x(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_s390x(process_sp));
}
return ABISP();
}

View File

@ -1091,11 +1091,8 @@ size_t ABISysV_x86_64::GetRedZoneSize() const { return 128; }
ABISP
ABISysV_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
static ABISP g_abi_sp;
if (arch.GetTriple().getArch() == llvm::Triple::x86_64) {
if (!g_abi_sp)
g_abi_sp.reset(new ABISysV_x86_64(process_sp));
return g_abi_sp;
return ABISP(new ABISysV_x86_64(process_sp));
}
return ABISP();
}