[llvm] [X86] Use StringRef::contains (NFC) (PR #139379)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat May 10 07:41:50 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/139379
Note that StringRef::count counts the number of ocurrences. We can
use StringRef::contains here because we only care about whether we
have at least one occurrence.
>From ce9e959b557da0d01b3fcceae2232dda687a8b26 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 9 May 2025 23:02:34 -0700
Subject: [PATCH] [X86] Use StringRef::contains (NFC)
Note that StringRef::count counts the number of ocurrences. We can
use StringRef::contains here because we only care about whether we
have at least one occurrence.
---
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 8221679f1969c..86b4d8254355b 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -2032,7 +2032,7 @@ bool X86AsmParser::ParseIntelExpression(IntelExprStateMachine &SM, SMLoc &End) {
const MCExpr *Val;
if (isParsingMSInlineAsm() || Parser.isParsingMasm()) {
// MS Dot Operator expression
- if (Identifier.count('.') &&
+ if (Identifier.contains('.') &&
(PrevTK == AsmToken::RBrac || PrevTK == AsmToken::RParen)) {
if (ParseIntelDotOperator(SM, End))
return true;
More information about the llvm-commits
mailing list