aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-04-14 21:41:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-06-22 18:20:56 +0000
commitbdd1243df58e60e85101c09001d9812a789b6bc4 (patch)
treea1ce621c7301dd47ba2ddc3b8eaa63b441389481 /contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp
parent781624ca2d054430052c828ba8d2c2eaf2d733e7 (diff)
parente3b557809604d036af6e00c60f012c2025b59a5e (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp b/contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp
index 393861c73a4a..7ce4b6ab161c 100644
--- a/contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp
+++ b/contrib/llvm-project/llvm/lib/Support/RISCVAttributeParser.cpp
@@ -40,7 +40,7 @@ const RISCVAttributeParser::DisplayHandler
Error RISCVAttributeParser::unalignedAccess(unsigned tag) {
static const char *strings[] = {"No unaligned access", "Unaligned access"};
- return parseStringAttribute("Unaligned_access", tag, makeArrayRef(strings));
+ return parseStringAttribute("Unaligned_access", tag, ArrayRef(strings));
}
Error RISCVAttributeParser::stackAlign(unsigned tag) {
@@ -53,10 +53,9 @@ Error RISCVAttributeParser::stackAlign(unsigned tag) {
Error RISCVAttributeParser::handler(uint64_t tag, bool &handled) {
handled = false;
- for (unsigned AHI = 0, AHE = array_lengthof(displayRoutines); AHI != AHE;
- ++AHI) {
- if (uint64_t(displayRoutines[AHI].attribute) == tag) {
- if (Error e = (this->*displayRoutines[AHI].routine)(tag))
+ for (const auto &AH : displayRoutines) {
+ if (uint64_t(AH.attribute) == tag) {
+ if (Error e = (this->*AH.routine)(tag))
return e;
handled = true;
break;