Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CallOpConversion final : public OpConversionPattern<func::CallOp> {

rewriter.replaceOpWithNewOp<emitc::CallOp>(
callOp,
callOp.getNumResults() ? callOp.getResult(0).getType() : nullptr,
callOp.getNumResults() ? callOp.getResult(0).getType() : TypeRange{},
adaptor.getOperands(), callOp->getAttrs());

return success();
Expand Down
16 changes: 16 additions & 0 deletions mlir/test/Conversion/FuncToEmitC/func-to-emitc.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,19 @@ func.func @call(%arg0: i32) -> i32 {

// CHECK-LABEL: emitc.func private @return_i32(i32) -> i32 attributes {specifiers = ["extern"]}
func.func private @return_i32(%arg0: i32) -> i32

// -----

// CHECK-LABEL: emitc.func private @return_void() attributes {specifiers = ["static"]}
// CHECK-NEXT: emitc.return
func.func private @return_void() {
return
}

// CHECK-LABEL: emitc.func @call()
// CHECK-NEXT: emitc.call @return_void() : () -> ()
// CHECK-NEXT: emitc.return
func.func @call() {
call @return_void() : () -> ()
return
}