aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-11-26 13:47:32 -0800
committerKazu Hirata <kazu@google.com>2022-11-26 13:47:32 -0800
commit589725f6e803d77adedc3fb5a1cbeaddb99f439a (patch)
tree947cebe2b683e28094d5a224533782f7bc6f5f9a /llvm/lib/IR/Attributes.cpp
parent25f01d593ce296078f57e872778b77d074ae5888 (diff)
downloadllvm-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.cpp3
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;
}