diff --git a/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp b/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp --- a/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp +++ b/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp @@ -46,7 +46,7 @@ /// struct StackFrameLayoutAnalysisPass : public MachineFunctionPass { using SlotDbgMap = - SmallDenseMap>; + SmallDenseMap>; static char ID; enum SlotType { @@ -180,18 +180,15 @@ << MFI.getStackProtectorIndex() << "\n"); std::vector SlotInfo; - SmallDenseMap SlotOffsetMap; const unsigned int NumObj = MFI.getNumObjects(); SlotInfo.reserve(NumObj); - SlotOffsetMap.reserve(NumObj); // initialize slot info for (int Idx = MFI.getObjectIndexBegin(), EndIdx = MFI.getObjectIndexEnd(); Idx != EndIdx; ++Idx) { if (MFI.isDeadObjectIndex(Idx)) continue; - auto &Inserted = SlotInfo.emplace_back(MFI, ValOffset, Idx); - SlotOffsetMap[Inserted.Slot] = Inserted.Offset; + SlotInfo.emplace_back(MFI, ValOffset, Idx); } // sort the ordering, to match the actual layout in memory @@ -214,7 +211,7 @@ // add variables to the map for (MachineFunction::VariableDbgInfo &DI : MF.getVariableDbgInfo()) - SlotDebugMap[DI.Slot].insert(DI.Var); + SlotDebugMap[DI.Slot].push_back(DI.Var); // Then add all the spills that have debug data for (MachineBasicBlock &MBB : MF) { @@ -231,7 +228,7 @@ MI.collectDebugValues(Dbg); for (MachineInstr *MI : Dbg) - SlotDebugMap[FrameIdx].insert(MI->getDebugVariable()); + SlotDebugMap[FrameIdx].push_back(MI->getDebugVariable()); } } }