[llvm] f3bacd0 - Fix some more -Wrange-loop-analysis warnings in AArch64TargetParser
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 4 16:58:08 PST 2020
Author: Reid Kleckner
Date: 2020-02-04T16:57:49-08:00
New Revision: f3bacd0738e9d911b78f03abc041aa3d618716bd
URL: https://github.com/llvm/llvm-project/commit/f3bacd0738e9d911b78f03abc041aa3d618716bd
DIFF: https://github.com/llvm/llvm-project/commit/f3bacd0738e9d911b78f03abc041aa3d618716bd.diff
LOG: Fix some more -Wrange-loop-analysis warnings in AArch64TargetParser
Added:
Modified:
llvm/lib/Support/AArch64TargetParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/AArch64TargetParser.cpp b/llvm/lib/Support/AArch64TargetParser.cpp
index b5cd4af0eb3d..32b9402fb158 100644
--- a/llvm/lib/Support/AArch64TargetParser.cpp
+++ b/llvm/lib/Support/AArch64TargetParser.cpp
@@ -191,7 +191,7 @@ AArch64::ArchKind AArch64::parseArch(StringRef Arch) {
return ArchKind::INVALID;
StringRef Syn = ARM::getArchSynonym(Arch);
- for (const auto A : AArch64ARCHNames) {
+ for (const auto &A : AArch64ARCHNames) {
if (A.getName().endswith(Syn))
return A.ID;
}
@@ -199,7 +199,7 @@ AArch64::ArchKind AArch64::parseArch(StringRef Arch) {
}
AArch64::ArchExtKind AArch64::parseArchExt(StringRef ArchExt) {
- for (const auto A : AArch64ARCHExtNames) {
+ for (const auto &A : AArch64ARCHExtNames) {
if (ArchExt == A.getName())
return static_cast<ArchExtKind>(A.ID);
}
@@ -207,7 +207,7 @@ AArch64::ArchExtKind AArch64::parseArchExt(StringRef ArchExt) {
}
AArch64::ArchKind AArch64::parseCPUArch(StringRef CPU) {
- for (const auto C : AArch64CPUNames) {
+ for (const auto &C : AArch64CPUNames) {
if (CPU == C.getName())
return C.ArchID;
}
More information about the llvm-commits
mailing list