aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/RISCVAttributeParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:11 +0000
commite3b557809604d036af6e00c60f012c2025b59a5e (patch)
tree8a11ba2269a3b669601e2fd41145b174008f4da8 /llvm/lib/Support/RISCVAttributeParser.cpp
parent08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (diff)
Diffstat (limited to 'llvm/lib/Support/RISCVAttributeParser.cpp')
-rw-r--r--llvm/lib/Support/RISCVAttributeParser.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Support/RISCVAttributeParser.cpp b/llvm/lib/Support/RISCVAttributeParser.cpp
index 393861c73a4a..7ce4b6ab161c 100644
--- a/llvm/lib/Support/RISCVAttributeParser.cpp
+++ b/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;