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

Simon Camphausen llvmlistbot at llvm.org
Mon Feb 5 02:49:37 PST 2024


================
@@ -771,6 +771,22 @@ static LogicalResult printOperation(CppEmitter &emitter, ModuleOp moduleOp) {
   return success();
 }
 
+static LogicalResult printFunctionArgs(CppEmitter &emitter,
+                                       Operation *functionOp,
+                                       ArrayRef<Type> arguments) {
+  raw_indented_ostream &os = emitter.ostream();
+
+  if (failed(interleaveCommaWithError(
+          arguments, os, [&](Type arg) -> LogicalResult {
+            if (failed(emitter.emitType(functionOp->getLoc(), arg)))
+              return failure();
+            return success();
+          })))
+    return failure();
+
+  return success();
----------------
simon-camp wrote:

At least the outer if can be dropped there as well. Would make sense to me to keep this is sync.

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


More information about the Mlir-commits mailing list