From: Archibald Elliott Date: Fri, 25 Feb 2022 18:39:34 +0000 (+0000) Subject: [NFC][Clang][AArch64] Clean up AArch64TargetInfo::hasFeature X-Git-Tag: upstream/15.0.7~15105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=220da125c423b71ce1507df84b75f54d274bc63d;p=platform%2Fupstream%2Fllvm.git [NFC][Clang][AArch64] Clean up AArch64TargetInfo::hasFeature --- diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp index bd03d88..964cf5c8 100644 --- a/clang/lib/Basic/Targets/AArch64.cpp +++ b/clang/lib/Basic/Targets/AArch64.cpp @@ -511,14 +511,12 @@ AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts) const { } bool AArch64TargetInfo::hasFeature(StringRef Feature) const { - return Feature == "aarch64" || Feature == "arm64" || Feature == "arm" || - (Feature == "neon" && (FPU & NeonMode)) || - ((Feature == "sve" || Feature == "sve2" || Feature == "sve2-bitperm" || - Feature == "sve2-aes" || Feature == "sve2-sha3" || - Feature == "sve2-sm4" || Feature == "f64mm" || Feature == "f32mm" || - Feature == "i8mm" || Feature == "bf16") && - (FPU & SveMode)) || - (Feature == "ls64" && HasLS64); + return llvm::StringSwitch(Feature) + .Cases("aarch64", "arm64", "arm", true) + .Case("neon", FPU & NeonMode) + .Cases("sve", "sve2", "sve2-bitperm", "sve2-aes", "sve2-sha3", "sve2-sm4", "f64mm", "f32mm", "i8mm", "bf16", FPU & SveMode) + .Case("ls64", HasLS64) + .Default(false); } bool AArch64TargetInfo::handleTargetFeatures(std::vector &Features,