From: Amara Emerson Date: Fri, 6 Aug 2021 06:21:08 +0000 (-0700) Subject: Delete copy-ctor of MachineFrameInfo. X-Git-Tag: upstream/15.0.7~34512 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fee756c75af4bb6367508626ceb5ba12bd04eb8;p=platform%2Fupstream%2Fllvm.git 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. --- diff --git a/llvm/include/llvm/CodeGen/MachineFrameInfo.h b/llvm/include/llvm/CodeGen/MachineFrameInfo.h index 28a5970..5df4681 100644 --- a/llvm/include/llvm/CodeGen/MachineFrameInfo.h +++ b/llvm/include/llvm/CodeGen/MachineFrameInfo.h @@ -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(); } diff --git a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp index ea41442..9f2aec6 100644 --- a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp +++ b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp @@ -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;