From f3bacd0738e9d911b78f03abc041aa3d618716bd Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 4 Feb 2020 16:57:49 -0800 Subject: [PATCH] Fix some more -Wrange-loop-analysis warnings in AArch64TargetParser --- llvm/lib/Support/AArch64TargetParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Support/AArch64TargetParser.cpp b/llvm/lib/Support/AArch64TargetParser.cpp index b5cd4af..32b9402 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(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; } -- 2.7.4