Debug Info: Emitting a register in DwarfExpression may fail. Report the
[opencl/llvm.git] / lib / CodeGen / AsmPrinter / AsmPrinterDwarf.cpp
index b13f394b4c0786f541ea7a0ccee1c6a84fb80142..e02b05c5fbd48f1e01ada46c1be68e4493be4561 100644 (file)
@@ -244,7 +244,10 @@ void AsmPrinter::EmitDwarfRegOp(ByteStreamer &Streamer,
                          "nop (could not find a dwarf register number)");
 
     // Attempt to find a valid super- or sub-register.
                          "nop (could not find a dwarf register number)");
 
     // Attempt to find a valid super- or sub-register.
-    return Expr.AddMachineRegPiece(MLoc.getReg());
+    if (!Expr.AddMachineRegPiece(MLoc.getReg()))
+      Expr.EmitOp(dwarf::DW_OP_nop,
+                  "nop (could not find a dwarf register number)");
+    return;
   }
 
   if (MLoc.isIndirect())
   }
 
   if (MLoc.isIndirect())