aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2018-08-23 05:39:02 +0000
committerChandler Carruth <chandlerc@gmail.com>2018-08-23 05:39:02 +0000
commit8505dcf7459ef6fafe1326ecc1fe6b67d4d95739 (patch)
tree8425dd63d63f26d86b6f5224849c6d58467a7d4e /llvm/lib/CodeGen/LiveDebugVariables.cpp
parent8715e034776d8da9d9d9ab844f57f53813b15d2f (diff)
downloadllvm-8505dcf7459ef6fafe1326ecc1fe6b67d4d95739.zip
llvm-8505dcf7459ef6fafe1326ecc1fe6b67d4d95739.tar.gz
llvm-8505dcf7459ef6fafe1326ecc1fe6b67d4d95739.tar.bz2
Revert r340508: [DebugInfo] Fix bug in LiveDebugVariables.
This patch's test case relies on debug prints which isn't generally an OK way to test stuff in LLVM and fails whenever asserts aren't enabled. I've send a heads-up to the commit and detailed comments on the review. llvm-svn: 340513
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 3d934bf..3ff03ec 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -578,28 +578,23 @@ bool LDVImpl::collectDebugValues(MachineFunction &mf) {
MachineBasicBlock *MBB = &*MFI;
for (MachineBasicBlock::iterator MBBI = MBB->begin(), MBBE = MBB->end();
MBBI != MBBE;) {
- // Use the first debug instruction in the sequence to get a SlotIndex
- // for following consecutive debug instructions.
- if (!MBBI->isDebugInstr()) {
+ if (!MBBI->isDebugValue()) {
++MBBI;
continue;
}
- // Debug instructions has no slot index. Use the previous
- // non-debug instruction's SlotIndex as its SlotIndex.
+ // DBG_VALUE has no slot index, use the previous instruction instead.
SlotIndex Idx =
MBBI == MBB->begin()
? LIS->getMBBStartIdx(MBB)
: LIS->getInstructionIndex(*std::prev(MBBI)).getRegSlot();
- // Handle consecutive debug instructions with the same slot index.
+ // Handle consecutive DBG_VALUE instructions with the same slot index.
do {
- // Only handle DBG_VALUE in handleDebugValue(). Skip all other
- // kinds of debug instructions.
- if (MBBI->isDebugValue() && handleDebugValue(*MBBI, Idx)) {
+ if (handleDebugValue(*MBBI, Idx)) {
MBBI = MBB->erase(MBBI);
Changed = true;
} else
++MBBI;
- } while (MBBI != MBBE && MBBI->isDebugInstr());
+ } while (MBBI != MBBE && MBBI->isDebugValue());
}
}
return Changed;