It does not make sense to extract whole DW_TAG_partial_unit only to find out it is a partial unit and so it cannot be indexed on its own.
All DWZ patches are also applied in: git clone -b dwz git://git.jankratochvil.net/lldb
See inline comments.
All of these changes can be avoided by just appropriately checking for partial units and skipping them in this index function. Do you plan on using this functionality in any other place? I would rather you just fix this function to filter out the partial units.