[PATCH] D87935: DebugInfo: Filter DWARFv5 TUs out of the debug_info unit list when CUs requested

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 00:03:16 PDT 2020


jhenderson added a comment.

In D87935#2285841 <https://reviews.llvm.org/D87935#2285841>, @dblaikie wrote:

> In D87935#2284630 <https://reviews.llvm.org/D87935#2284630>, @jhenderson wrote:
>
>> If I had to pick between the two existing options, I think I have a marginal preference for this one, since it requires less code and is less surprising to someone who might not be too familiar with the code - I would expect a list of units to be in offset order naturally, and not expect to have to go through some sort of sorting procedure in the future.
>
> Fair - appreciate the perspective. One other wrinkle here is that if we support the "type_units()" API (I don't think anyone's actually using it, so I'd probably delete it for now) it'll need to use a fancy iterator solution too - concat_iterator + filter_iterator to take the v5 type units out of the debug_info units, and concat that with the v4 type units from debug_types.

I'm happy for that little extra complexity. I think it intuitively makes sense, even if it does mean messing about a little in the code.



================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:166
 
+  static bool CUOnly(const std::unique_ptr<DWARFUnit> &U) {
+    return !U->isTypeUnit();
----------------
Fixes the clang-tidy warning, and also more in keeping with `isTypeUnit`. (Also `isCU` would be acceptable).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87935/new/

https://reviews.llvm.org/D87935



More information about the llvm-commits mailing list