[clang] 3c93c03 - [Basic] Use StringRef::ends_with (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 3 21:43:18 PST 2024
Author: Kazu Hirata
Date: 2024-02-03T21:43:05-08:00
New Revision: 3c93c037c9ede2eaa0bdea6924c92d646ca0cfe5
URL: https://github.com/llvm/llvm-project/commit/3c93c037c9ede2eaa0bdea6924c92d646ca0cfe5
DIFF: https://github.com/llvm/llvm-project/commit/3c93c037c9ede2eaa0bdea6924c92d646ca0cfe5.diff
LOG: [Basic] Use StringRef::ends_with (NFC)
Added:
Modified:
clang/lib/Basic/Targets/X86.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp
index c6fc17fcc1b70..1966af17904d6 100644
--- a/clang/lib/Basic/Targets/X86.cpp
+++ b/clang/lib/Basic/Targets/X86.cpp
@@ -139,7 +139,7 @@ bool X86TargetInfo::initFeatureMap(
if (Feature.substr(1, 6) == "avx10.") {
if (Feature[0] == '+') {
HasAVX10 = true;
- if (Feature.substr(Feature.size() - 3, 3) == "512")
+ if (StringRef(Feature).ends_with("512"))
HasAVX10_512 = true;
LastAVX10 = Feature;
} else if (HasAVX10 && Feature == "-avx10.1-256") {
More information about the cfe-commits
mailing list