This is an archive of the discontinued LLVM Phabricator instance.

Support: Avoid using SmallVector::set_size()
ClosedPublic

Authored by dexonsmith on Dec 8 2021, 1:11 PM.

Details

Summary

Update platform-independent code in Support to stop using
SmallVector::set_size().

  • For sys::path, descrease size using truncate() instead of set_size().
  • For zlib, replace two pairs of reserve() / set_size() with resize_for_overwrite() and truncate().

See also Unix- and Windows-specific patches at:

Depends on https://reviews.llvm.org/D115383 or successor; blocker for https://reviews.llvm.org/D115380.

Diff Detail

Event Timeline

dexonsmith created this revision.Dec 8 2021, 1:11 PM
dexonsmith requested review of this revision.Dec 8 2021, 1:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2021, 1:11 PM
dblaikie accepted this revision.Dec 8 2021, 1:45 PM
dblaikie added a subscriber: dblaikie.

Probably worth committing separately in case either causes breakage.

This revision is now accepted and ready to land.Dec 8 2021, 1:45 PM
This revision was landed with ongoing or failed builds.Dec 8 2021, 4:22 PM
This revision was automatically updated to reflect the committed changes.

Probably worth committing separately in case either causes breakage.

Thanks for the review! Committed separately as 7df18557791ea1cf8f4f55d97d47ff5008f3bbbb and cd7bc0e010a3c0b4eb349e8c9a0e7edd591a5fff.

Just thinking now it'd have been better to push separately too -- likely you were implying that -- but at least now they're separately revertible.

Probably worth committing separately in case either causes breakage.

Thanks for the review! Committed separately as 7df18557791ea1cf8f4f55d97d47ff5008f3bbbb and cd7bc0e010a3c0b4eb349e8c9a0e7edd591a5fff.

Just thinking now it'd have been better to push separately too -- likely you were implying that -- but at least now they're separately revertible.

Yeah - can be good to space them out so they get separate runs through CI - I don't always remember to do this either.