Remove FrameAccess struct from hasLoadFromStackSlot
This removes the FrameAccess struct that was added to the interface
in D51537, since the PseudoValue from the MachineMemoryOperand
can be safely casted to a FixedStackPseudoSourceValue.
Reviewers: MatzeB, thegameg, javed.absar
Reviewed By: thegameg
Differential Revision: https://reviews.llvm.org/D51617
llvm-svn: 341454
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index c8e564e..63c5b26 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -750,19 +750,21 @@
const MachineFrameInfo &MFI = MF->getFrameInfo();
bool Commented = false;
- auto getSize = [&MFI](
- const SmallVectorImpl<TargetInstrInfo::FrameAccess> &Accesses) {
- unsigned Size = 0;
- for (auto &A : Accesses)
- if (MFI.isSpillSlotObjectIndex(A.FI))
- Size += A.MMO->getSize();
- return Size;
- };
+ auto getSize =
+ [&MFI](const SmallVectorImpl<const MachineMemOperand *> &Accesses) {
+ unsigned Size = 0;
+ for (auto A : Accesses)
+ if (MFI.isSpillSlotObjectIndex(
+ cast<FixedStackPseudoSourceValue>(A->getPseudoValue())
+ ->getFrameIndex()))
+ Size += A->getSize();
+ return Size;
+ };
// We assume a single instruction only has a spill or reload, not
// both.
const MachineMemOperand *MMO;
- SmallVector<TargetInstrInfo::FrameAccess, 2> Accesses;
+ SmallVector<const MachineMemOperand *, 2> Accesses;
if (TII->isLoadFromStackSlotPostFE(MI, FI)) {
if (MFI.isSpillSlotObjectIndex(FI)) {
MMO = *MI.memoperands_begin();