diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/CodeGen/StackColoring.cpp | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'llvm/lib/CodeGen/StackColoring.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackColoring.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
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<int, int> &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<DILocalVariable>(VI.Var)->getName() << "].\n"); - VI.Slot = SlotRemap[VI.Slot]; + VI.updateStackSlot(SlotRemap[Slot]); FixedDbg++; } } |