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

Marius Brehler llvmlistbot at llvm.org
Mon Feb 5 02:45:44 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();
----------------
marbre wrote:

That is a nearly 1:1 takeover from the existing `printFunctionArgs` implementation. Do you intended that I fix this as part of this PR as well?

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


More information about the Mlir-commits mailing list