Recognize the eax/ebp/eip etc version of x86 register

names in addition to the rax/rbp/rip register names when
deciding whether a register is volatile or not.

llvm-svn: 164812
This commit is contained in:
Jason Molenda 2012-09-28 05:46:55 +00:00
parent 210ebe93f3
commit f49306a2c6
1 changed files with 10 additions and 2 deletions

View File

@ -1169,6 +1169,16 @@ ABISysV_x86_64::RegisterIsCalleeSaved (const RegisterInfo *reg_info)
return name[3] == '\0';
break;
default:
break;
}
}
// Accept shorter-variant versions, rbx/ebx, rip/ eip, etc.
if (name[0] == 'r' || name[0] == 'e')
{
switch (name[1])
{
case 'b': // rbp, rbx
if (name[2] == 'p' || name[2] == 'x')
return name[3] == '\0';
@ -1184,8 +1194,6 @@ ABISysV_x86_64::RegisterIsCalleeSaved (const RegisterInfo *reg_info)
return name[3] == '\0';
break;
default:
break;
}
}
}