[llvm] 599f261 - [NFC][ADT] Clean up EnumeratedArray.h
Jannik Silvanus via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 18 05:38:17 PDT 2022
Author: Jannik Silvanus
Date: 2022-10-18T14:34:56+02:00
New Revision: 599f261c9258e1e1d7f8228cc5ae88b4fa6f846d
URL: https://github.com/llvm/llvm-project/commit/599f261c9258e1e1d7f8228cc5ae88b4fa6f846d
DIFF: https://github.com/llvm/llvm-project/commit/599f261c9258e1e1d7f8228cc5ae88b4fa6f846d.diff
LOG: [NFC][ADT] Clean up EnumeratedArray.h
As discussed in D135594, remove superfluous inline
attributes, and remove top-level consts on function arguments.
Added:
Modified:
llvm/include/llvm/ADT/EnumeratedArray.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/EnumeratedArray.h b/llvm/include/llvm/ADT/EnumeratedArray.h
index f54a50446c6e0..cece71d1be245 100644
--- a/llvm/include/llvm/ADT/EnumeratedArray.h
+++ b/llvm/include/llvm/ADT/EnumeratedArray.h
@@ -30,17 +30,17 @@ class EnumeratedArray {
Underlying[IX] = V;
}
}
- inline const ValueType &operator[](const Enumeration Index) const {
+ const ValueType &operator[](Enumeration Index) const {
auto IX = static_cast<const IndexType>(Index);
assert(IX >= 0 && IX < Size && "Index is out of bounds.");
return Underlying[IX];
}
- inline ValueType &operator[](const Enumeration Index) {
+ ValueType &operator[](Enumeration Index) {
return const_cast<ValueType &>(
static_cast<const EnumeratedArray<ValueType, Enumeration, LargestEnum,
IndexType, Size> &>(*this)[Index]);
}
- inline IndexType size() { return Size; }
+ IndexType size() { return Size; }
private:
ValueType Underlying[Size];
More information about the llvm-commits
mailing list