[lldb] Use std::size instead of llvm::array_lengthof

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.

Differential Revision: https://reviews.llvm.org/D133501
This commit is contained in:
Joe Loser
2022-09-08 09:05:04 -06:00
parent e413eb6cf8
commit 47b76631e7
38 changed files with 114 additions and 123 deletions

View File

@@ -743,7 +743,7 @@ bool ObjectFilePECOFF::ParseSectionHeaders(
}
llvm::StringRef ObjectFilePECOFF::GetSectionName(const section_header_t &sect) {
llvm::StringRef hdr_name(sect.name, llvm::array_lengthof(sect.name));
llvm::StringRef hdr_name(sect.name, std::size(sect.name));
hdr_name = hdr_name.split('\0').first;
if (hdr_name.consume_front("/")) {
lldb::offset_t stroff;