[llvm] [AMDGPU][AsmParser] Simplify getting source locations of operands. (PR #158323)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 04:34:24 PDT 2025


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 -- llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
``````````

: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/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index 915a106f6..dbd7b62e4 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -2292,7 +2292,8 @@ uint64_t AMDGPUOperand::applyInputFPModifiers(uint64_t Val, unsigned Size) const
   return Val;
 }
 
-void AMDGPUOperand::addImmOperands(MCInst &Inst, unsigned N, bool ApplyModifiers) {
+void AMDGPUOperand::addImmOperands(MCInst &Inst, unsigned N,
+                                   bool ApplyModifiers) {
   MCOpIdx = Inst.getNumOperands();
 
   if (isExpr()) {
@@ -7274,8 +7275,7 @@ addOptionalImmOperand(MCInst &Inst, const OperandVector &Operands,
   auto i = OptionalIdx.find(ImmT);
   if (i != OptionalIdx.end()) {
     unsigned Idx = i->second;
-    AMDGPUOperand &Op =
-        static_cast<AMDGPUOperand &>(*Operands[Idx]);
+    AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands[Idx]);
     if (InsertAt)
       Inst.insert(Inst.begin() + *InsertAt, MCOperand::createImm(Op.getImm()));
     else

``````````

</details>


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


More information about the llvm-commits mailing list