Delete copy-ctor of MachineFrameInfo.

I just hit a nasty bug when writing a unit test after calling MF->getFrameInfo()
without declaring the variable as a reference.

Deleting the copy-constructor also showed a place in the ARM backend which was
doing the same thing, albeit it didn't impact correctness there from the looks of it.
This commit is contained in:
Amara Emerson 2021-08-05 23:21:08 -07:00
parent 666ee849f0
commit 4fee756c75
2 changed files with 3 additions and 1 deletions

View File

@ -342,6 +342,8 @@ public:
: StackAlignment(assumeAligned(StackAlignment)),
StackRealignable(StackRealignable), ForcedRealign(ForcedRealign) {}
MachineFrameInfo(const MachineFrameInfo &) = delete;
/// Return true if there are any stack objects in this function.
bool hasStackObjects() const { return !Objects.empty(); }

View File

@ -1121,7 +1121,7 @@ static bool ValidateMVEStore(MachineInstr *MI, MachineLoop *ML) {
return false;
int FI = GetFrameIndex(MI->memoperands().front());
MachineFrameInfo FrameInfo = MI->getParent()->getParent()->getFrameInfo();
auto &FrameInfo = MI->getParent()->getParent()->getFrameInfo();
if (FI == -1 || !FrameInfo.isSpillSlotObjectIndex(FI))
return false;