summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-04-28 20:03:13 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-04-28 20:03:13 +0000
commitd4d1a51895929a22ae13a27616e71b91c5ce9662 (patch)
treec04b6b2864268c6fc45077f4e2c3dfdfa59f7c35 /llvm/lib/CodeGen/MachineInstr.cpp
parente82411b47f76591248c434c4983be4914f0d51b6 (diff)
downloadbcm5719-llvm-d4d1a51895929a22ae13a27616e71b91c5ce9662.tar.gz
bcm5719-llvm-d4d1a51895929a22ae13a27616e71b91c5ce9662.zip
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 llvm-svn: 102518
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 9f855d9db28..99b5beb1365 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud