From 77562c74e5709ea6bb5756074fa4f450171a25a0 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 28 Apr 2011 20:46:18 +0000 Subject: [PATCH] Beautify debug info probe output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130435 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/DebugInfoProbe.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/VMCore/DebugInfoProbe.cpp b/lib/VMCore/DebugInfoProbe.cpp index 408153f34eb..43eda47dbe1 100644 --- a/lib/VMCore/DebugInfoProbe.cpp +++ b/lib/VMCore/DebugInfoProbe.cpp @@ -136,7 +136,9 @@ void DebugInfoProbeImpl::finalize(Function &F) { unsigned LineNo = *I; if (LineNos2.count(LineNo) == 0) { DEBUG(dbgs() - << "DebugInfoProbe: Losing dbg info for source line " + << "DebugInfoProbe(" + << PassName + << "): Losing dbg info for source line " << LineNo << "\n"); ++NumDbgLineLost; } @@ -162,9 +164,16 @@ void DebugInfoProbeImpl::finalize(Function &F) { for (std::set::iterator I = DbgVariables.begin(), E = DbgVariables.end(); I != E; ++I) { - if (DbgVariables2.count(*I) == 0) { - DEBUG(dbgs() << "DebugInfoProbe: Losing dbg info for variable: "); - DEBUG((*I)->print(dbgs())); + if (DbgVariables2.count(*I) == 0 && (*I)->getNumOperands() >= 2) { + DEBUG(dbgs() + << "DebugInfoProbe(" + << PassName + << "): Losing dbg info for variable: "); + if (MDString *MDS = dyn_cast_or_null((*I)->getOperand(2))) + DEBUG(dbgs() << MDS->getString()); + else + DEBUG(dbgs() << "..."); + DEBUG(dbgs() << "\n"); ++NumDbgValueLost; } }