This is an archive of the discontinued LLVM Phabricator instance.

Support: Avoid SmallVector::set_size() in Unix code
ClosedPublic

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

Details

Summary

Replace a reserve()/set_size() pair with resize_for_overwrite()
and truncate(). The out parameter also needs a clear() call on the
error path.

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:06 PM
dexonsmith requested review of this revision.Dec 8 2021, 1:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2021, 1:06 PM
dexonsmith updated this revision to Diff 392976.Dec 8 2021, 4:33 PM

Adding a couple of potential reviewers.

[No change in diff; just retrigging CI after a spurious failure.]

mstorsjo accepted this revision.Dec 9 2021, 2:47 AM

LGTM

This revision is now accepted and ready to land.Dec 9 2021, 2:47 AM
This revision was automatically updated to reflect the committed changes.