[llvm-branch-commits] [llvm] [MC] Make MCParsedAsmOperand const in validateOperandClass (PR #245077)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Nov 22 12:30:39 PST 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 cpp,h -- llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp llvm/utils/TableGen/AsmMatcherEmitter.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/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 66b08d3e9..3a13d70da 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -13061,8 +13061,9 @@ bool ARMAsmParser::parseDirectiveArchExtension(SMLoc L) {
 
 // Define this matcher function after the auto-generated include so we
 // have the match class enum definitions.
-unsigned ARMAsmParser::validateTargetOperandClass(const MCParsedAsmOperand &AsmOp,
-                                                  unsigned Kind) {
+unsigned
+ARMAsmParser::validateTargetOperandClass(const MCParsedAsmOperand &AsmOp,
+                                         unsigned Kind) {
   const ARMOperand &Op = static_cast<const ARMOperand &>(AsmOp);
   // If the kind is a token for a literal immediate, check if our asm
   // operand matches. This is for InstAliases which have a fixed-value
diff --git a/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp b/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
index 79cc0be95..fe850deb2 100644
--- a/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
+++ b/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
@@ -748,8 +748,9 @@ extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRAsmParser() {
 #include "AVRGenAsmMatcher.inc"
 
 // Uses enums defined in AVRGenAsmMatcher.inc
-unsigned AVRAsmParser::validateTargetOperandClass(const MCParsedAsmOperand &AsmOp,
-                                                  unsigned ExpectedKind) {
+unsigned
+AVRAsmParser::validateTargetOperandClass(const MCParsedAsmOperand &AsmOp,
+                                         unsigned ExpectedKind) {
   const AVROperand &Op = static_cast<const AVROperand &>(AsmOp);
   MatchClassKind Expected = static_cast<MatchClassKind>(ExpectedKind);
   if (Expected <= MCK_LAST_TOKEN || Expected > MCK_LAST_REGISTER)
diff --git a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
index 0a19b0357..f45e31f4d 100644
--- a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
+++ b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
@@ -1830,8 +1830,9 @@ LLVMInitializePowerPCAsmParser() {
 
 // Define this matcher function after the auto-generated include so we
 // have the match class enum definitions.
-unsigned PPCAsmParser::validateTargetOperandClass(const MCParsedAsmOperand &AsmOp,
-                                                  unsigned Kind) {
+unsigned
+PPCAsmParser::validateTargetOperandClass(const MCParsedAsmOperand &AsmOp,
+                                         unsigned Kind) {
   // If the kind is a token for a literal immediate, check if our asm
   // operand matches. This is for InstAliases which have a fixed-value
   // immediate in the syntax.

``````````

</details>


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


More information about the llvm-branch-commits mailing list