mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
Change MRegisterDesc::AliasSet, TargetInstrDescriptor::ImplicitDefs
and TargetInstrDescriptor::ImplicitUses to always point to a null terminated array and never be null. So there is no need to check for pointer validity when iterating over those sets. Code that looked like: if (const unsigned* AS = TID.ImplicitDefs) { for (int i = 0; AS[i]; ++i) { // use AS[i] } } was changed to: for (const unsigned* AS = TID.ImplicitDefs; *AS; ++AS) { // use *AS } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -127,12 +127,15 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
|
||||
unsigned Reg = CSRegs[i];
|
||||
if (ModifiedRegs[Reg]) {
|
||||
RegsToSave.push_back(Reg); // If modified register...
|
||||
} else if (const unsigned *AliasSet = RegInfo->getAliasSet(Reg))
|
||||
for (unsigned j = 0; AliasSet[j]; ++j) // Check alias registers too...
|
||||
if (ModifiedRegs[AliasSet[j]]) {
|
||||
} else {
|
||||
for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
|
||||
*AliasSet; ++AliasSet) { // Check alias registers too...
|
||||
if (ModifiedRegs[*AliasSet]) {
|
||||
RegsToSave.push_back(Reg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (RegsToSave.empty())
|
||||
|
Reference in New Issue
Block a user