[PATCH] D55721: llvm-dwarfdump: Improve/fix pretty printing of array dimensions

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 14:36:54 PST 2018


dblaikie marked 3 inline comments as done.
dblaikie added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFDie.cpp:207
       if (C.getTag() == DW_TAG_subrange_type) {
-        OS << '[';
-        uint64_t LowerBound = 0;
+        Optional<uint64_t> LB;
+        Optional<uint64_t> Count;
----------------
JDevlieghere wrote:
> nit: Could we maybe extract this into a static dumpArray helper?
Sure - done!


================
Comment at: lib/DebugInfo/DWARF/DWARFDie.cpp:180
+        OS << "[]";
+      if (!LB && (Count || UB) && DefaultLB)
+        OS << '[' << (Count ? *Count : *UB - *DefaultLB + 1) << ']';
----------------
probinson wrote:
> `else if` here? Otherwise it looks like the no-attributes-at-all case would dump
> `[][[?,?)]` which  seems like overkill.
Ah, thanks - good catch. Added a test & fixed the issue.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55721/new/

https://reviews.llvm.org/D55721





More information about the llvm-commits mailing list