From 789e257ce0d84ef5ddbabfdf0c990b2878e67744 Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Sat, 30 Nov 2019 23:48:32 +0300 Subject: [DWARF5][Debuginfo] Compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) do not match. That patch fixes incompatible compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) error. cat split-dwarf.cpp int main() { int a = 1; 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. The fix is to change DW_TAG_compile_unit into DW_TAG_skeleton_unit when skeleton file is generated. Differential Revision: https://reviews.llvm.org/D70880 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 1b7ea2673ac..8491d078ed8 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -40,6 +40,8 @@ class MCExpr; class MCSymbol; class MDNode; +enum class UnitKind { Skeleton, Full }; + class DwarfCompileUnit final : public DwarfUnit { /// A numeric ID unique among all CUs in the module unsigned UniqueID; @@ -104,7 +106,8 @@ class DwarfCompileUnit final : public DwarfUnit { public: DwarfCompileUnit(unsigned UID, const DICompileUnit *Node, AsmPrinter *A, - DwarfDebug *DW, DwarfFile *DWU); + DwarfDebug *DW, DwarfFile *DWU, + UnitKind Kind = UnitKind::Full); bool hasRangeLists() const { return HasRangeLists; } unsigned getUniqueID() const { return UniqueID; } -- cgit v1.2.3