Commit 4fee756c authored by Amara Emerson's avatar Amara Emerson
Browse files

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.
parent 666ee849
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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(); }

+1 −1
Original line number Diff line number Diff line
@@ -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;