[llvm] [MCParser] Deduplicate isIdentifierChar. (#218100) (PR #218851)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 00:16:11 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- llvm/include/llvm/MC/MCParser/AsmLexer.h llvm/lib/MC/MCParser/AsmLexer.cpp llvm/lib/MC/MCParser/AsmParser.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/MC/MCParser/AsmLexer.h b/llvm/include/llvm/MC/MCParser/AsmLexer.h
index 6b7cdb8d7..2cd9a0f43 100644
--- a/llvm/include/llvm/MC/MCParser/AsmLexer.h
+++ b/llvm/include/llvm/MC/MCParser/AsmLexer.h
@@ -132,8 +132,8 @@ public:
   }
 
   /// LexIdentifier: [a-zA-Z_$.@?][a-zA-Z0-9_$.@#?]*
-  static LLVM_ATTRIBUTE_ALWAYS_INLINE
-  bool isIdentifierChar(char C, bool AllowAt = false, bool AllowHash = false) {
+  static LLVM_ATTRIBUTE_ALWAYS_INLINE bool
+  isIdentifierChar(char C, bool AllowAt = false, bool AllowHash = false) {
     return llvm::isAlnum(C) || C == '_' || C == '$' || C == '.' || C == '?' ||
            (AllowAt && C == '@') || (AllowHash && C == '#');
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/218851


More information about the llvm-commits mailing list