[ADT] Mark `llvm::array_lengthof` as deprecated

As a follow-up of 5e96cea1db, mark
`llvm::array_lengthof` as deprecated in favor of using `std::size` function
directly.

Differential Revision: https://reviews.llvm.org/D133502
This commit is contained in:
Joe Loser 2022-09-08 09:13:17 -06:00
parent 1173ecf9fb
commit 5758c824da
1 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,8 @@
#include <cstddef>
#include "llvm/Support/Compiler.h"
namespace llvm {
//===----------------------------------------------------------------------===//
@ -26,7 +28,8 @@ namespace llvm {
/// Find the length of an array.
template <class T, std::size_t N>
constexpr inline size_t array_lengthof(T (&)[N]) {
constexpr inline LLVM_DEPRECATED("Use std::size instead.", "std::size") size_t
array_lengthof(T (&)[N]) {
return N;
}