[PATCH] D109499: [DebugInfo][NFC] Erase capacity in DWARFUnit::clearDIEs().

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 11:39:32 PDT 2021


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

eh, curious. Fair enough.

Might be a simpler/tidier way to write this, not sure...

  DieArray = (KeepCUDie && !DieArray.empty()) ? std::vector<DWARFDebugInfoEntry>({DieArray[0]}) : std::vector<DWARFDebugInfoEntry>();

Maybe that'd work? Maybe include a comment about not using shrink_to_fit because some implementations don't respect it under certain conditions? (possibly naming the specific implementation/conditions to make it easier for someone to know whether the workaround is still useful if they're revisiting this code in the future)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109499



More information about the llvm-commits mailing list