summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-08-04 20:44:26 +0000
committerDevang Patel <dpatel@apple.com>2011-08-04 20:44:26 +0000
commitd61b1d505ceb7b9ba39915b252529691ef4e1f44 (patch)
treea860ac3958a5fdb6ae4ecb16ca2553fd34a81cb6 /llvm/lib/CodeGen/MachineInstr.cpp
parenteabc3cea33b614fc8a40e5afc12861bc130b3dec (diff)
downloadbcm5719-llvm-d61b1d505ceb7b9ba39915b252529691ef4e1f44.tar.gz
bcm5719-llvm-d61b1d505ceb7b9ba39915b252529691ef4e1f44.zip
Print DBG_VALUE variable's location info as a comment.
llvm-svn: 136916
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 143a29b08a1..97fe6f48935 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1516,7 +1516,19 @@ void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const {
}
// Print debug location information.
- if (!debugLoc.isUnknown() && MF) {
+ if (isDebugValue() && getOperand(e - 1).isMetadata()) {
+ if (!HaveSemi) OS << ";"; HaveSemi = true;
+ DIVariable DV(getOperand(e - 1).getMetadata());
+ OS << " line no:" << DV.getLineNumber();
+ if (MDNode *InlinedAt = DV.getInlinedAt()) {
+ DebugLoc InlinedAtDL = DebugLoc::getFromDILocation(InlinedAt);
+ if (!InlinedAtDL.isUnknown()) {
+ OS << " inlined @[ ";
+ printDebugLoc(InlinedAtDL, MF, OS);
+ OS << " ]";
+ }
+ }
+ } else if (!debugLoc.isUnknown() && MF) {
if (!HaveSemi) OS << ";"; HaveSemi = true;
OS << " dbg:";
printDebugLoc(debugLoc, MF, OS);
OpenPOWER on IntegriCloud