This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Use more appropriate SmallVectorImpl::append call in std::initializer_list SmallVector constructor
ClosedPublic

Authored by yurai007 on Jul 22 2022, 7:21 AM.

Details

Summary

Since we are in constructor there is no need to perform redundant call to SmallVectorImpl::clear() inside assign function.
Although calling cheaper append function instead assign doesn't make any difference on optimized builds (DSE does the job removing stores), we still save some cycles
for debug binaries.

Diff Detail

Event Timeline

yurai007 created this revision.Jul 22 2022, 7:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2022, 7:21 AM
yurai007 requested review of this revision.Jul 22 2022, 7:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2022, 7:21 AM
nikic accepted this revision.Jul 22 2022, 7:40 AM

LGTM

This revision is now accepted and ready to land.Jul 22 2022, 7:40 AM
This revision was landed with ongoing or failed builds.Jul 30 2022, 1:14 AM
This revision was automatically updated to reflect the committed changes.