mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-13 20:25:12 +00:00
Remove uses of getCalleeSavedRegClasses from outside the
backends and removes the virtual declaration. With that out of the way I should be able to cleanup one backend at a time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -202,22 +202,18 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
|
||||
if (Fn.getFunction()->hasFnAttr(Attribute::Naked))
|
||||
return;
|
||||
|
||||
// Figure out which *callee saved* registers are modified by the current
|
||||
// function, thus needing to be saved and restored in the prolog/epilog.
|
||||
const TargetRegisterClass * const *CSRegClasses =
|
||||
RegInfo->getCalleeSavedRegClasses(&Fn);
|
||||
|
||||
std::vector<CalleeSavedInfo> CSI;
|
||||
for (unsigned i = 0; CSRegs[i]; ++i) {
|
||||
unsigned Reg = CSRegs[i];
|
||||
const TargetRegisterClass *RC = RegInfo->getMinimalPhysRegClass(Reg);
|
||||
if (Fn.getRegInfo().isPhysRegUsed(Reg)) {
|
||||
// If the reg is modified, save it!
|
||||
CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
|
||||
CSI.push_back(CalleeSavedInfo(Reg, RC));
|
||||
} else {
|
||||
for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
|
||||
*AliasSet; ++AliasSet) { // Check alias registers too.
|
||||
if (Fn.getRegInfo().isPhysRegUsed(*AliasSet)) {
|
||||
CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
|
||||
CSI.push_back(CalleeSavedInfo(Reg, RC));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user