[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 10:43:55 PDT 2018


probinson added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:101
+    if (I != this->end() &&
+        (&(*I)->getInfoSection() != &Section || (*I)->getOffset() == Offset)) {
       ++I;
----------------
aprantl wrote:
> Side note:I find this loop to be a bit hard to follow... but it's been this way since before you touched it.
And it took me the longest time to work out what it was doing; I hope the comment helps.  Coming up with a better name for `I` might aid readability too.   Another one for The List.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:107
     if (!U)
       break;
     Offset = U->getNextUnitOffset();
----------------
aprantl wrote:
> might be nice to comment what the `break` means (did the parsing fail, are we at the end?).
Right, it means parsing failed.  The `isValidOffset` at the top decides when we've reached the end of the section.  I'll add another comment here.


https://reviews.llvm.org/D49744





More information about the llvm-commits mailing list