FreeBSDThread::GetRegisterContext is only for FreeBSD targets

The removal of in-process Linux debug support left a switch statement
with llvm::Triple::FreeBSD as the only case. Simplify by replacing it
with a now-equivalent assertion.

llvm-svn: 243468
This commit is contained in:
Ed Maste 2015-07-28 19:47:00 +00:00
parent a32fa81c09
commit a43ce0dc98
1 changed files with 20 additions and 29 deletions

View File

@ -157,42 +157,33 @@ FreeBSDThread::GetRegisterContext()
RegisterInfoInterface *reg_interface = NULL;
const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
switch (target_arch.GetTriple().getOS())
assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
switch (target_arch.GetMachine())
{
case llvm::Triple::FreeBSD:
switch (target_arch.GetMachine())
{
case llvm::Triple::arm:
reg_interface = new RegisterContextFreeBSD_arm(target_arch);
break;
case llvm::Triple::ppc:
case llvm::Triple::arm:
reg_interface = new RegisterContextFreeBSD_arm(target_arch);
break;
case llvm::Triple::ppc:
#ifndef __powerpc64__
reg_interface = new RegisterContextFreeBSD_powerpc32(target_arch);
break;
reg_interface = new RegisterContextFreeBSD_powerpc32(target_arch);
break;
#endif
case llvm::Triple::ppc64:
reg_interface = new RegisterContextFreeBSD_powerpc64(target_arch);
break;
case llvm::Triple::mips64:
reg_interface = new RegisterContextFreeBSD_mips64(target_arch);
break;
case llvm::Triple::x86:
reg_interface = new RegisterContextFreeBSD_i386(target_arch);
break;
case llvm::Triple::x86_64:
reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
break;
default:
break;
}
case llvm::Triple::ppc64:
reg_interface = new RegisterContextFreeBSD_powerpc64(target_arch);
break;
case llvm::Triple::mips64:
reg_interface = new RegisterContextFreeBSD_mips64(target_arch);
break;
case llvm::Triple::x86:
reg_interface = new RegisterContextFreeBSD_i386(target_arch);
break;
case llvm::Triple::x86_64:
reg_interface = new RegisterContextFreeBSD_x86_64(target_arch);
break;
default:
break;
llvm_unreachable("CPU not supported");
}
assert(reg_interface && "OS or CPU not supported!");
switch (target_arch.GetMachine())
{
case llvm::Triple::aarch64: