[Lldb-commits] [PATCH] D47275: 1/3: DWARFDIE split out to DWARFBasicDIE

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 24 10:16:29 PDT 2018


clayborg added a comment.

In https://reviews.llvm.org/D47275#1110772, @labath wrote:

> I don't think a name like `DWARFUnitDIE` is a good one bacause it would make a weird `is-a` relationship (a DWARFDIE represetning a DW_TAG_variable is certainly **not** a "unit DIE" yet you could assign it to a  `DWARFUnitDIE&`). We could have a DWARFUnitDIE type if we wanted to, but that would have to be a special type in addition to DWARFBasicDIE. However, I think that would be overkill.


Yeah, we just need to be able to tell the difference between the top level DIE we hand out with no children and the one that has all the abilities.

> That said, if everyone who is going to be calling `IsStructOrClass` and friends will see the type as `DWARFDIE` then keeping those methods on that class makes sense.

Yes, that is the case. No top level DIE can be a struct, union or class. Only a compile unit, type unit or partial unit.


https://reviews.llvm.org/D47275





More information about the lldb-commits mailing list