This is an archive of the discontinued LLVM Phabricator instance.

[clang] Use std::size instead of llvm::array_lengthof
ClosedPublic

Authored by jloser on Sep 8 2022, 1:32 PM.

Details

Summary

LLVM contains a helpful function for getting the size of a C-style
array: llvm::array_lengthof. This is useful prior to C++17, but not as
helpful for C++17 or later: std::size already has support for C-style
arrays.

Change call sites to use std::size instead. Leave the few call sites that
use a locally defined array_lengthof that are meant to test previous bugs
with NTTPs in clang analyzer and SemaTemplate.

Diff Detail

Event Timeline

jloser created this revision.Sep 8 2022, 1:32 PM
jloser requested review of this revision.Sep 8 2022, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2022, 1:32 PM
gribozavr2 accepted this revision.Sep 8 2022, 1:42 PM
This revision is now accepted and ready to land.Sep 8 2022, 1:42 PM
This revision was automatically updated to reflect the committed changes.