File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -433,6 +433,10 @@ void X86RegisterInfo::adjustStackMapLiveOutMask(uint32_t *Mask) const {
433
433
// Stack Frame Processing methods
434
434
// ===----------------------------------------------------------------------===//
435
435
436
+ static bool CantUseSP (const MachineFrameInfo *MFI) {
437
+ return MFI->hasVarSizedObjects () || MFI->hasOpaqueSPAdjustment ();
438
+ }
439
+
436
440
bool X86RegisterInfo::hasBasePointer (const MachineFunction &MF) const {
437
441
const MachineFrameInfo *MFI = MF.getFrameInfo ();
438
442
@@ -445,9 +449,7 @@ bool X86RegisterInfo::hasBasePointer(const MachineFunction &MF) const {
445
449
// reference locals while also adjusting the stack pointer. When we can't
446
450
// use both the SP and the FP, we need a separate base pointer register.
447
451
bool CantUseFP = needsStackRealignment (MF);
448
- bool CantUseSP =
449
- MFI->hasVarSizedObjects () || MFI->hasOpaqueSPAdjustment ();
450
- return CantUseFP && CantUseSP;
452
+ return CantUseFP && CantUseSP (MFI);
451
453
}
452
454
453
455
bool X86RegisterInfo::canRealignStack (const MachineFunction &MF) const {
@@ -464,7 +466,7 @@ bool X86RegisterInfo::canRealignStack(const MachineFunction &MF) const {
464
466
465
467
// If a base pointer is necessary. Check that it isn't too late to reserve
466
468
// it.
467
- if (MFI-> hasVarSizedObjects ( ))
469
+ if (CantUseSP (MFI ))
468
470
return MRI->canReserveReg (BasePtr);
469
471
return true ;
470
472
}
You can’t perform that action at this time.
0 commit comments