diff options
author | Kazu Hirata <kazu@google.com> | 2022-11-26 13:47:32 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-11-26 13:47:32 -0800 |
commit | 589725f6e803d77adedc3fb5a1cbeaddb99f439a (patch) | |
tree | 947cebe2b683e28094d5a224533782f7bc6f5f9a /llvm/lib/IR/Attributes.cpp | |
parent | 25f01d593ce296078f57e872778b77d074ae5888 (diff) | |
download | llvm-589725f6e803d77adedc3fb5a1cbeaddb99f439a.zip llvm-589725f6e803d77adedc3fb5a1cbeaddb99f439a.tar.gz llvm-589725f6e803d77adedc3fb5a1cbeaddb99f439a.tar.bz2 |
[llvm] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index a9c4b9f..1a90b94 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -600,8 +600,7 @@ enum AttributeProperty { static bool hasAttributeProperty(Attribute::AttrKind Kind, AttributeProperty Prop) { unsigned Index = Kind - 1; - assert(Index < sizeof(AttrPropTable) / sizeof(AttrPropTable[0]) && - "Invalid attribute kind"); + assert(Index < std::size(AttrPropTable) && "Invalid attribute kind"); return AttrPropTable[Index] & Prop; } |