This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][NFC] Replace most of std::vector with SmallVector
ClosedPublic

Authored by owenpan on Jul 10 2022, 11:59 PM.

Diff Detail

Event Timeline

owenpan created this revision.Jul 10 2022, 11:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2022, 11:59 PM
owenpan requested review of this revision.Jul 10 2022, 11:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2022, 11:59 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Jul 11 2022, 12:37 PM
curdeius added inline comments.Jul 14 2022, 3:18 AM
clang/lib/Format/ContinuationIndenter.cpp
40

Sorry for a late comment. I think that in a parameter list, we should use SmallVectorBase to avoid changing the type if the inplace element count changes. That's not important now though.

owenpan added inline comments.Jul 15 2022, 1:18 AM
clang/lib/Format/ContinuationIndenter.cpp
40

Hmm. I can't find an example of SmallVectorBase in llvm-project sources, though.

curdeius added inline comments.Jul 15 2022, 2:09 AM
clang/lib/Format/ContinuationIndenter.cpp
40
owenpan added inline comments.Jul 15 2022, 5:48 PM
clang/lib/Format/ContinuationIndenter.cpp
40

Good catch, though ArrayRef is more appropriate in this case. See https://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h. Fixed in a7789d6.