[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
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 7f5ef15..27e6a05 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -315,9 +315,7 @@
for (auto Range : Ranges) {
if (!Range.valid()) {
++NumErrors;
- error() << format("Invalid address range [0x%08" PRIx64 " - 0x%08" PRIx64
- "].\n",
- Range.LowPC, Range.HighPC);
+ error() << "Invalid address range " << Range << "\n";
continue;
}
@@ -325,11 +323,8 @@
const auto IntersectingRange = RI.insert(Range);
if (IntersectingRange != RI.Ranges.end()) {
++NumErrors;
- error() << format("DIE has overlapping address ranges: [0x%08" PRIx64
- " - 0x%08" PRIx64 "] and [0x%08" PRIx64
- " - 0x%08" PRIx64 "].\n",
- Range.LowPC, Range.HighPC, IntersectingRange->LowPC,
- IntersectingRange->HighPC);
+ error() << "DIE has overlapping address ranges: " << Range << " and "
+ << *IntersectingRange << "\n";
break;
}
}