Skip to content

Commit

Permalink
Delete copy-ctor of MachineFrameInfo.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aemerson committed Aug 6, 2021
1 parent 666ee84 commit 4fee756
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions llvm/include/llvm/CodeGen/MachineFrameInfo.h
Expand Up @@ -342,6 +342,8 @@ class MachineFrameInfo {
: 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(); }

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
Expand Up @@ -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;

Expand Down

0 comments on commit 4fee756

Please sign in to comment.