From 7fa27ce4a07f19b07799a767fc29416f3b625afb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 26 Jul 2023 21:03:47 +0200 Subject: Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. --- llvm/lib/CodeGen/StackColoring.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/StackColoring.cpp') diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp index 11c6bdc69956..66b9086e1d88 100644 --- a/llvm/lib/CodeGen/StackColoring.cpp +++ b/llvm/lib/CodeGen/StackColoring.cpp @@ -407,8 +407,8 @@ namespace { /// StackColoring - A machine pass for merging disjoint stack allocations, /// marked by the LIFETIME_START and LIFETIME_END pseudo instructions. class StackColoring : public MachineFunctionPass { - MachineFrameInfo *MFI; - MachineFunction *MF; + MachineFrameInfo *MFI = nullptr; + MachineFunction *MF = nullptr; /// A class representing liveness information for a single basic block. /// Each bit in the BitVector represents the liveness property @@ -448,7 +448,7 @@ class StackColoring : public MachineFunctionPass { VNInfo::Allocator VNInfoAllocator; /// SlotIndex analysis object. - SlotIndexes *Indexes; + SlotIndexes *Indexes = nullptr; /// The list of lifetime markers found. These markers are to be removed /// once the coloring is done. @@ -935,12 +935,13 @@ void StackColoring::remapInstructions(DenseMap &SlotRemap) { // Remap debug information that refers to stack slots. for (auto &VI : MF->getVariableDbgInfo()) { - if (!VI.Var) + if (!VI.Var || !VI.inStackSlot()) continue; - if (SlotRemap.count(VI.Slot)) { + int Slot = VI.getStackSlot(); + if (SlotRemap.count(Slot)) { LLVM_DEBUG(dbgs() << "Remapping debug info for [" << cast(VI.Var)->getName() << "].\n"); - VI.Slot = SlotRemap[VI.Slot]; + VI.updateStackSlot(SlotRemap[Slot]); FixedDbg++; } } -- cgit v1.2.3