Check operand type first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102468 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 8cdb94c..be65b82 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2083,7 +2083,8 @@
         continue;
 
       // Ignore Undef values.
-      if (!MInsn->getOperand(0).getReg())
+      if (MInsn->getOperand(0).getType() == MachineOperand::MO_Register
+          && !MInsn->getOperand(0).getReg())
         continue;
 
       DIVariable DV(