From 866cf8f3afa0224e31d36ca0351ac5cb0d303757 Mon Sep 17 00:00:00 2001 From: Bjorn Pettersson Date: Tue, 6 Mar 2018 13:23:28 +0000 Subject: [PATCH] Fixup for rL326769 (RegState::Debug is being truncated to a bool) I obviously messed up arguments to MachineOperand::CreateReg in rL326769. This should make it work as intended. Thanks to RKSimon for spotting this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326780 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveDebugVariables.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp index f3fcd004defd..8c547cdcff33 100644 --- a/lib/CodeGen/LiveDebugVariables.cpp +++ b/lib/CodeGen/LiveDebugVariables.cpp @@ -557,8 +557,11 @@ bool LDVImpl::handleDebugValue(MachineInstr &MI, SlotIndex Idx) { getUserValue(Var, Expr, MI.getDebugLoc()); if (!Discard) UV->addDef(Idx, MI.getOperand(0), IsIndirect); - else - UV->addDef(Idx, MachineOperand::CreateReg(0U, RegState::Debug), false); + else { + MachineOperand MO = MachineOperand::CreateReg(0U, false); + MO.setIsDebug(); + UV->addDef(Idx, MO, false); + } return true; }