[Mlir-commits] [mlir] [MLIR] Fix import of calls with mismatched variadic types (PR #124286)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 24 07:25:01 PST 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 c546b5317c518987a5f45dd4c4d25321a955c758 c7891a48b81106a3e77a83356a100bb93c87a752 --extensions cpp -- mlir/lib/Target/LLVMIR/ModuleImport.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
index b8f66357d9..5cb3591f34 100644
--- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
@@ -1614,8 +1614,7 @@ LogicalResult ModuleImport::convertInstruction(llvm::Instruction *inst) {
       if (!resultTy)
         return failure();
       auto callOp = builder.create<InlineAsmOp>(
-          loc, resultTy, operands,
-          builder.getStringAttr(asmI->getAsmString()),
+          loc, resultTy, operands, builder.getStringAttr(asmI->getAsmString()),
           builder.getStringAttr(asmI->getConstraintString()),
           /*has_side_effects=*/true,
           /*is_align_stack=*/false, /*asm_dialect=*/nullptr,
@@ -1625,14 +1624,14 @@ LogicalResult ModuleImport::convertInstruction(llvm::Instruction *inst) {
       else
         mapNoResultOp(inst, callOp);
     } else {
-      auto funcTy = dyn_cast<LLVMFunctionType>([&] () -> Type {
+      auto funcTy = dyn_cast<LLVMFunctionType>([&]() -> Type {
         // Retrieve the real function type. For direct calls, use the callee's
         // function type, as it may differ from the operand type in the case of
         // variadic functions. For indirect calls, use the call function type.
         if (auto callee = dyn_cast<llvm::Function>(calledOperand))
           return convertType(callee->getFunctionType());
         return convertType(callInst->getFunctionType());
-      }() );
+      }());
 
       if (!funcTy)
         return failure();

``````````

</details>


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


More information about the Mlir-commits mailing list