[PATCH] D49744: [DebugInfo/DWARF] [4/4] De-segregate type units and compile units. NFC
Paul Robinson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 31 06:32:04 PDT 2018
probinson 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; }
----------------
JDevlieghere wrote:
> 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?
Will doxygen-ize all these new methods to clarify.
================
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);
----------------
JDevlieghere wrote:
> 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.
I can do something along those lines.
Repository:
rL LLVM
https://reviews.llvm.org/D49744
More information about the llvm-commits
mailing list