[llvm] 35df882 - [ADT] Remove deprecated `llvm::array_lengthof`

Joe Loser via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 20 10:56:48 PST 2022


Author: Joe Loser
Date: 2022-11-20T11:56:30-07:00
New Revision: 35df882274e9fb9d1fb67d1b39865523281392df

URL: https://github.com/llvm/llvm-project/commit/35df882274e9fb9d1fb67d1b39865523281392df
DIFF: https://github.com/llvm/llvm-project/commit/35df882274e9fb9d1fb67d1b39865523281392df.diff

LOG: [ADT] Remove deprecated `llvm::array_lengthof`

`llvm::array_lengthof` was marked deprecated a bit over two months ago in
5758c824dab4851fd061201483987b338c051417.  Now, finally remove it.  Since this
function was the only one in `STLArrayExtras.h`, get rid of the whole header.

D118342 (2022-01) moved the function to `STLArrayExtras.h`. This function should
have very few users now (MaskRay made some downstream inspection in
https://reviews.llvm.org/D133502#3777981). D133502 deprecated the function.

Differential Revision: https://reviews.llvm.org/D138374

Added: 
    

Modified: 
    

Removed: 
    llvm/include/llvm/ADT/STLArrayExtras.h


################################################################################
diff  --git a/llvm/include/llvm/ADT/STLArrayExtras.h b/llvm/include/llvm/ADT/STLArrayExtras.h
deleted file mode 100644
index 80739ee4378e..000000000000
--- a/llvm/include/llvm/ADT/STLArrayExtras.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===- llvm/ADT/STLArrayExtras.h - additions to <array> ---------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains some templates that are useful if you are working with the
-// STL at all.
-//
-// No library is required when using these functions.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_STLARRAYEXTRAS_H
-#define LLVM_ADT_STLARRAYEXTRAS_H
-
-#include <cstddef>
-
-#include "llvm/Support/Compiler.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-//     Extra additions for arrays
-//===----------------------------------------------------------------------===//
-
-/// Find the length of an array.
-template <class T, std::size_t N>
-LLVM_DEPRECATED("Use std::size instead.", "std::size")
-constexpr inline size_t array_lengthof(T (&)[N]) {
-  return N;
-}
-
-} // end namespace llvm
-
-#endif // LLVM_ADT_STLARRAYEXTRAS_H


        


More information about the llvm-commits mailing list