summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-07-14 21:50:04 +0000
committerDevang Patel <dpatel@apple.com>2011-07-14 21:50:04 +0000
commit3dcb4ef757127d69c3748dec92787520e039bd53 (patch)
tree15db8cb53c0beb2ea380a6acceab7d4020172c48 /lib
parent151bd17a8fb540c84c3c297d27cedf0512ce02d3 (diff)
downloadllvm-3dcb4ef757127d69c3748dec92787520e039bd53.tar.gz
llvm-3dcb4ef757127d69c3748dec92787520e039bd53.tar.bz2
llvm-3dcb4ef757127d69c3748dec92787520e039bd53.tar.xz
Add dump()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/DebugLoc.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/VMCore/DebugLoc.cpp b/lib/VMCore/DebugLoc.cpp
index 92ab4396fa..4ff6b2cd80 100644
--- a/lib/VMCore/DebugLoc.cpp
+++ b/lib/VMCore/DebugLoc.cpp
@@ -144,6 +144,22 @@ DebugLoc DebugLoc::getFromDILexicalBlock(MDNode *N) {
return get(LineNo, ColNo, Scope, NULL);
}
+void DebugLoc::dump(const LLVMContext &Ctx) const {
+#ifndef NDEBUG
+ if (!isUnknown()) {
+ dbgs() << getLine();
+ if (getCol() != 0)
+ dbgs() << ',' << getCol();
+ DebugLoc InlinedAtDL = DebugLoc::getFromDILocation(getInlinedAt(Ctx));
+ if (!InlinedAtDL.isUnknown()) {
+ dbgs() << " @ ";
+ InlinedAtDL.dump(Ctx);
+ } else
+ dbgs() << "\n";
+ }
+#endif
+}
+
//===----------------------------------------------------------------------===//
// DenseMap specialization
//===----------------------------------------------------------------------===//