[PATCH] D45549: [DWARF v5] improved support for .debug_rnglists/consumer
Jonas Devlieghere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 12 08:32:13 PDT 2018
JDevlieghere added inline comments.
================
Comment at: include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h:120
+ default:
+ llvm_unreachable("Invalid DWARF format (expected DWARF32 or DWARF64");
+ }
----------------
Is `Format` checked before this function is called? If not, this should probably also be an `Optional` as it can fail due to bad input. Otherwise I'd add a comment specifying this as a pre-condition.
================
Comment at: lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp:200
+ default:
+ llvm_unreachable("Unsupported range list encoding");
+ }
----------------
Same as my other comment, we shouldn't crash on bad input.
================
Comment at: lib/DebugInfo/DWARF/DWARFUnit.cpp:152
+// following it (DWARF v5 and later).
+static Optional<DWARFDebugRnglistTable>
+parseRngListTableHeader(DWARFDataExtractor &DA, uint32_t Offset) {
----------------
Would it make sense to turn this into an Expected and propagate the Error from `extractHeaderAndOffsets`?
https://reviews.llvm.org/D45549
More information about the llvm-commits
mailing list