[PATCH] D49744: [DebugInfo/DWARF] [4/4] De-segregate type units and compile units. NFC
Jonas Devlieghere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 31 03:37:17 PDT 2018
JDevlieghere added inline comments.
================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h:126
DWARFSectionKind SectionKind, bool Lazy = false);
+ unsigned getNumUnits() { return size(); }
+ unsigned getNumInfoUnits() { return NumInfoUnits; }
----------------
probinson wrote:
> aprantl wrote:
> > Doxygen comment that explains that this returns all kinds of units?
> This entire class hierarchy could use doxygen-izing.
I guess it's slightly more pressing here, as otherwise you'd be left to guess whether it includes the DWO kind?
================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:555
DWARFCompileUnit *DWARFContext::getDWOCompileUnitForHash(uint64_t Hash) {
- if (DWOCUs.empty())
- DWOCUs.parseDWO(*this, DObj->getInfoDWOSection(), DW_SECT_INFO, true);
+ parseDWOUnits(/* Lazy= */ true);
----------------
I recently learned about this "trick" where you define an enum like `enum { parseLazy = true };`. Not sure if it's worth it here but I (personally) think it's nicer than the comment.
Repository:
rL LLVM
https://reviews.llvm.org/D49744
More information about the llvm-commits
mailing list