summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorGeoff Berry <gberry@codeaurora.org>2017-12-29 21:01:09 +0000
committerGeoff Berry <gberry@codeaurora.org>2017-12-29 21:01:09 +0000
commit39064346e3aacae955af4d51bd483f773a05e3b9 (patch)
tree1144726e86ccc2794a342a01ee3217d7bdceb112 /lib/CodeGen
parent7a691a48b11ef2aafbc2ec2b0c75783d4b4088d6 (diff)
[MachineOperand] Fix LiveDebugVariables code after isRenamable change.
Fix code in LiveDebugVariables that was changing def MachineOperands to uses, which will hit an assert for dead operands after the change to add the renamable bit to MachineOperands. Avoid the assert by clearing the dead bit before changing the operand to a use. Fixes issue reported in out of tree target by Jesper Antonsson at Ericsson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/LiveDebugVariables.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp
index 34572f24c18..75e3d35169c 100644
--- a/lib/CodeGen/LiveDebugVariables.cpp
+++ b/lib/CodeGen/LiveDebugVariables.cpp
@@ -242,8 +242,11 @@ public:
// We are storing a MachineOperand outside a MachineInstr.
locations.back().clearParent();
// Don't store def operands.
- if (locations.back().isReg())
+ if (locations.back().isReg()) {
+ if (locations.back().isDef())
+ locations.back().setIsDead(false);
locations.back().setIsUse();
+ }
return locations.size() - 1;
}