That patch fixes "incompatible compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit)" error.
cat split-dwarf.cpp
#include <iostream>
int main()
{
int a = 1; std::cout << "Split DWARF test" << std::endl; return 0;
}
clang++ -O -g -gsplit-dwarf -gdwarf-5 split-dwarf.cpp; llvm-dwarfdump --verify ./a.out | grep skeleton
error: Compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) do not match.
According to "3.1.2 Skeleton Compilation Unit Entries" part of "DWARF Debugging Information Format Version 5"
: "When generating a split DWARF object file (see Section 7.3.2 on page 187), the
compilation unit in the .debug_info section is a "skeleton" compilation unit with
the tag DW_TAG_skeleton_unit".
The fix is to change DW_TAG_compile_unit into DW_TAG_skeleton_unit tag when skeleton file is generated.