[Mlir-commits] [mlir] [llvm] [mlir][EmitC] Add func, call and return operations and conversions (PR #79612)
Simon Camphausen
llvmlistbot at llvm.org
Mon Jan 29 00:49:01 PST 2024
================
@@ -495,18 +495,33 @@ static LogicalResult printOperation(CppEmitter &emitter,
return success();
}
-static LogicalResult printOperation(CppEmitter &emitter, func::CallOp callOp) {
- if (failed(emitter.emitAssignPrefix(*callOp.getOperation())))
+static LogicalResult printCallOperation(CppEmitter &emitter, Operation *callOp,
+ StringRef callee) {
+ if (failed(emitter.emitAssignPrefix(*callOp)))
return failure();
raw_ostream &os = emitter.ostream();
- os << callOp.getCallee() << "(";
- if (failed(emitter.emitOperands(*callOp.getOperation())))
+ os << callee << "(";
+ if (failed(emitter.emitOperands(*callOp)))
return failure();
os << ")";
return success();
}
+static LogicalResult printOperation(CppEmitter &emitter, func::CallOp callOp) {
+ Operation *operation = callOp.getOperation();
+ StringRef callee = callOp.getCallee();
+
+ return (printCallOperation(emitter, operation, callee));
+}
+
+static LogicalResult printOperation(CppEmitter &emitter, emitc::CallOp callOp) {
+ Operation *operation = callOp.getOperation();
+ StringRef callee = callOp.getCallee();
+
+ return (printCallOperation(emitter, operation, callee));
----------------
simon-camp wrote:
Remove parenthesis
https://github.com/llvm/llvm-project/pull/79612
More information about the Mlir-commits
mailing list