From 4607019142cd764352cf9cdb4e4ead824b911d5d Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 16 Aug 2017 17:43:01 +0000 Subject: [PATCH] Add a convenience overload of DWARFDie::dump() for debugging purposes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311026 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo/DWARF/DWARFDie.h | 4 ++++ lib/DebugInfo/DWARF/DWARFDie.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/llvm/DebugInfo/DWARF/DWARFDie.h b/include/llvm/DebugInfo/DWARF/DWARFDie.h index b216491b615..e28cc6c1785 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFDie.h +++ b/include/llvm/DebugInfo/DWARF/DWARFDie.h @@ -123,6 +123,10 @@ public: void dump(raw_ostream &OS, unsigned recurseDepth, unsigned indent = 0, DIDumpOptions DumpOpts = DIDumpOptions()) const; + + /// Convenience zero-argument overload for debugging. + LLVM_DUMP_METHOD void dump() const; + /// Extract the specified attribute from this DIE. /// /// Extract an attribute value from this DIE only. This call doesn't look diff --git a/lib/DebugInfo/DWARF/DWARFDie.cpp b/lib/DebugInfo/DWARF/DWARFDie.cpp index 09c004453dd..42e014f87ff 100644 --- a/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -377,6 +377,8 @@ void DWARFDie::dump(raw_ostream &OS, unsigned RecurseDepth, unsigned Indent, } } +LLVM_DUMP_METHOD void DWARFDie::dump() const { dump(llvm::errs(), 0); } + DWARFDie DWARFDie::getParent() const { if (isValid()) return U->getParent(Die); -- 2.11.0