diff options
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index d3a09f06ebd..6ca8ead1c77 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1469,10 +1469,23 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,      return;    bool HaveSemi = false; +    // Print debug location information. +  if (const DebugLoc &DL = getDebugLoc()) { +    if (!HaveSemi) { +      OS << ';'; +      HaveSemi = true; +    } +    OS << ' '; +    DL.print(OS); +  } + +  // Print extra comments for DEBUG_VALUE.    if (isDebugValue() && getOperand(e - 2).isMetadata()) { -    if (!HaveSemi) +    if (!HaveSemi) {        OS << ";"; +      HaveSemi = true; +    }      auto *DV = cast<DILocalVariable>(getOperand(e - 2).getMetadata());      OS << " line no:" <<  DV->getLine();      if (auto *InlinedAt = debugLoc->getInlinedAt()) {  | 

