Ignore DBG_VALUE instructions that points to undef values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102463 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index f7b4c09..8cdb94c 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2081,6 +2081,11 @@
// FIXME : Lift this restriction.
if (MInsn->getNumOperands() != 3)
continue;
+
+ // Ignore Undef values.
+ if (!MInsn->getOperand(0).getReg())
+ continue;
+
DIVariable DV(
const_cast<MDNode *>(MInsn->getOperand(MInsn->getNumOperands() - 1)
.getMetadata()));