This patch is split off from https://reviews.llvm.org/D32779. It fixes a bug in the parsing of type unit headers. The bug will not manifest with compiler-generated TU dies due to their size, but it is there nonetheless and will show up with hand-crafted TU dies for testing purposes. This is in preparation for DWARF5 work.
The DWARF64 portion of the fix is not tested (yet), because in order to do so the DWARFUnit class would have to support DWARF64. This is not the case at the moment.
Do you need to give it any attributes at all?