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.
: 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(); }
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;