[Mlir-commits] [mlir] [mlir][EmitC] Add support for external functions (PR #80547)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Feb 3 07:40:03 PST 2024


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 e7d40a87ff230528131541f6ac17a2e1a7dc78e1 5a6975ce1c38a49743eb239a2e7f66425b9f4e8c -- mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp mlir/lib/Dialect/EmitC/IR/EmitC.cpp mlir/lib/Target/Cpp/TranslateToCpp.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp b/mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp
index 658b94613d..6a8ecb7b00 100644
--- a/mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp
+++ b/mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp
@@ -74,7 +74,8 @@ public:
       newFuncOp.setSpecifiersAttr(specifiers);
     }
 
-    // Add `static` to specifiers if `func.func` is private but not a declaration.
+    // Add `static` to specifiers if `func.func` is private but not a
+    // declaration.
     if (funcOp.isPrivate() && !funcOp.isDeclaration()) {
       ArrayAttr specifiers = rewriter.getStrArrayAttr({"static"});
       newFuncOp.setSpecifiersAttr(specifiers);
diff --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
index 0abbce5335..841d0a3456 100644
--- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp
+++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
@@ -930,7 +930,8 @@ static LogicalResult printOperation(CppEmitter &emitter,
   os << "(";
   Operation *operation = functionOp.getOperation();
   if (functionOp.isExternal()) {
-    if (failed(printFunctionArgs(emitter, operation, functionOp.getArgumentTypes())))
+    if (failed(printFunctionArgs(emitter, operation,
+                                 functionOp.getArgumentTypes())))
       return failure();
     os << ");";
     return success();

``````````

</details>


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


More information about the Mlir-commits mailing list