diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-04-28 20:03:13 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-04-28 20:03:13 +0000 |
commit | 59b3655564bb6717b296ca9e71f13bf7db45b590 (patch) | |
tree | 471187943c50c15b87ab2900aaac86b097b60824 | |
parent | e87f7bb50e1d08a09e29252806f6502dcff0539d (diff) | |
download | external_llvm-59b3655564bb6717b296ca9e71f13bf7db45b590.zip external_llvm-59b3655564bb6717b296ca9e71f13bf7db45b590.tar.gz external_llvm-59b3655564bb6717b296ca9e71f13bf7db45b590.tar.bz2 |
Pretty print DBG_VALUE machine instructions.
Before:
DBG_VALUE %RSI, 0, !-1; dbg:SimpleRegisterCoalescing.cpp:2707
Now:
DBG_VALUE %RSI, 0, !"this"; dbg:SimpleRegisterCoalescing.cpp:2707
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102518 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 9f855d9..99b5beb 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -1187,7 +1187,15 @@ void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const { if (TOI.isOptionalDef()) OS << "opt:"; } - MO.print(OS, TM); + if (isDebugValue() && MO.isMetadata()) { + // Pretty print DBG_VALUE instructions. + const MDNode *MD = MO.getMetadata(); + if (const MDString *MDS = dyn_cast<MDString>(MD->getOperand(2))) + OS << "!\"" << MDS->getString() << '\"'; + else + MO.print(OS, TM); + } else + MO.print(OS, TM); } // Briefly indicate whether any call clobbers were omitted. |