]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blobdiff - lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Change the informal convention of DBG_VALUE so that we can express a
[opencl/llvm.git] / lib / CodeGen / AsmPrinter / AsmPrinter.cpp
index 4a71ad333730bcab1f293a7bd74fe5c419e43e94..284b6165d0c530bbec89e1b61986fa89c0efa17e 100644 (file)
@@ -597,7 +597,9 @@ static bool emitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) {
     OS << AP.TM.getRegisterInfo()->getName(MI->getOperand(0).getReg());
   }
 
-  OS << '+' << MI->getOperand(1).getImm();
+  // It's only an offset if it's an immediate.
+  if (MI->getOperand(1).isImm())
+    OS << '+' << MI->getOperand(1).getImm();
   // NOTE: Want this comment at start of line, don't emit with AddComment.
   AP.OutStreamer.EmitRawText(OS.str());
   return true;