[PATCH] D70880: [DWARF5][Debuginfo] Not matching compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit)
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 3 14:27:07 PST 2019
avl marked an inline comment as done.
avl added a comment.
> @avl - are you planning to do the DW_TAG_split_compile/DW_TAG_split_type tags required by DWARFv5 too in separate patches?
My understanding is that everything is already done here. There is no DW_TAG_split_compile/DW_TAG_split_type tags. There should be used DW_TAG_compile_unit+DW_UT_split_compile and DW_TAG_type_unit+DW_UT_split_type. It looks like these already are set correctly.
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfFile.h:106-109
+ /// That value indicates whether we are generating file
+ /// containing skeleton compilation units.
+ bool IsSkeleton = false;
+
----------------
dblaikie wrote:
> Rather than adding this field - I think it'd be cleaner to pass the boolean (maybe use an `enum class UnitKind { Skeleton, Full }` to make it more readable) into the DwarfCompileUnit ctor directly. The two callers know statically which kind of unit they are constructing, so there would be no need for branching/conditionals/dynamic computation of the unit type by doing it that way.
>
> (& probably add it as a default argument ("Full") to the end, then only the Skeleton unit construction gets the extra argument)
I did not clearly get the idea...
1. add a parameter of enum class UnitKind to DwarfCompileUnit ctor.
2. add a method like this into DwarfFile:
```
UnitKind DwarfFile::GetCompileUnitType(){
if (Asm->getDwarfDebug()->getDwarfVersion() >= 5 && IsSkeleton)
return UnitKind::Skeleton;
return UnitKind::Full;
}
```
3. call GetCompileUnitType when creating DwarfCompileUnit.
is that correct?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70880/new/
https://reviews.llvm.org/D70880
More information about the llvm-commits
mailing list