This is an archive of the discontinued LLVM Phabricator instance.

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

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

Details

Summary

Replace a few reserve() / set_size() pairs with
resize_for_overwrite() / truncate() in the platform-specific
code for Windows.

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:08 PM
dexonsmith requested review of this revision.Dec 8 2021, 1:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2021, 1:08 PM

Adding some reviewers that have touched llvm/lib/Support/Windows recently. Note that I don't have access to a Windows machine and CI hasn't returned so I cannot confirm yet that this builds.

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

Looks good to me. The Windows CI seems to have failed on Other/test-changed.ll, but I applied this patch and ran all tests in a number of subprojects, so it seems safe in that sense at least.

This revision is now accepted and ready to land.Dec 9 2021, 2:46 AM
This revision was landed with ongoing or failed builds.Jan 11 2022, 5:56 PM
This revision was automatically updated to reflect the committed changes.

Looks good to me. The Windows CI seems to have failed on Other/test-changed.ll, but I applied this patch and ran all tests in a number of subprojects, so it seems safe in that sense at least.

Thanks for the review and the testing! Landed in 4d4439470eaf015784b76fc84cd5373456ce3d5c.