This is an archive of the discontinued LLVM Phabricator instance.

[clang][syntax] Replace `std::vector<bool>` use
ClosedPublic

Authored by jansvoboda11 on Jan 25 2022, 1:21 AM.

Details

Summary

LLVM Programmer’s Manual strongly discourages the use of std::vector<bool> and suggests llvm::BitVector as a possible replacement.

This patch replaces std::vector<bool> with llvm::BitVector in the Format library and replaces range-based for loop with regular for loop. This is necessary due to llvm::BitVector not having begin() and end() (D117116).

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Jan 25 2022, 1:21 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2022, 1:21 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dblaikie accepted this revision.Jan 25 2022, 9:17 AM
dblaikie added a subscriber: dblaikie.

Looks good, thanks!

This revision is now accepted and ready to land.Jan 25 2022, 9:17 AM
dexonsmith accepted this revision.Jan 25 2022, 9:59 AM

LGTM too.

jansvoboda11 retitled this revision from [clang] Replace `std::vector<bool>` use in Syntax to [clang][syntax] Replace `std::vector<bool>` use.Jan 26 2022, 2:17 AM
This revision was landed with ongoing or failed builds.Jan 26 2022, 2:20 AM
This revision was automatically updated to reflect the committed changes.