Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

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.

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.
@llvmbot
Copy link
Member

llvmbot commented May 10, 2025

@llvm/pr-subscribers-backend-x86

Author: Kazu Hirata (kazutakahirata)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/139379.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp (+1-1)
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;

@kazutakahirata kazutakahirata merged commit 1c8cc3b into llvm:main May 10, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_StringRef_count branch May 10, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants