From a15f25d325f7c2e354b19e0fc80a40e99892d93c Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 29 Sep 2017 15:41:22 +0000 Subject: [dwarfdump][NFC] Consistent printing of address ranges This implement the insertion operator for DWARF address ranges so they are consistently printed as [LowPC, HighPC). While a dump method might have felt more consistent, it is used exclusively for printing error messages in the verifier and never used for actual dumping. Hence this approach is more intuitive and creates less clutter at the call sites. Differential revision: https://reviews.llvm.org/D38395 llvm-svn: 314523 --- llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp') diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp index 62bd5af4e64..f0b7ec2751d 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp @@ -17,6 +17,11 @@ using namespace llvm; +raw_ostream &llvm::operator<<(raw_ostream &OS, const DWARFAddressRange &R) { + return OS << format("[0x%16.16" PRIx64 ", 0x%16.16" PRIx64 ")", R.LowPC, + R.HighPC); +} + void DWARFDebugRangeList::clear() { Offset = -1U; AddressSize = 0; -- cgit v1.2.3