diff options
author | Devang Patel <dpatel@apple.com> | 2011-08-04 20:44:26 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-08-04 20:44:26 +0000 |
commit | 4d3586dd230a3b16018da138404dbb87faf2008d (patch) | |
tree | c292b74238d758b7d4021371c3be65f9388111f0 | |
parent | d9f3fc7faaa7686af3e1a004d86397da9c8e0449 (diff) | |
download | external_llvm-4d3586dd230a3b16018da138404dbb87faf2008d.zip external_llvm-4d3586dd230a3b16018da138404dbb87faf2008d.tar.gz external_llvm-4d3586dd230a3b16018da138404dbb87faf2008d.tar.bz2 |
Print DBG_VALUE variable's location info as a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136916 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 143a29b..97fe6f4 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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); |