File tree 2 files changed +17
-1
lines changed
lib/Conversion/FuncToEmitC
test/Conversion/FuncToEmitC
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class CallOpConversion final : public OpConversionPattern<func::CallOp> {
38
38
39
39
rewriter.replaceOpWithNewOp <emitc::CallOp>(
40
40
callOp,
41
- callOp.getNumResults () ? callOp.getResult (0 ).getType () : nullptr ,
41
+ callOp.getNumResults () ? callOp.getResult (0 ).getType () : TypeRange{} ,
42
42
adaptor.getOperands (), callOp->getAttrs ());
43
43
44
44
return success ();
Original file line number Diff line number Diff line change @@ -58,3 +58,19 @@ func.func @call(%arg0: i32) -> i32 {
58
58
59
59
// CHECK-LABEL: emitc.func private @return_i32(i32) -> i32 attributes {specifiers = ["extern"]}
60
60
func.func private @return_i32 (%arg0: i32 ) -> i32
61
+
62
+ // -----
63
+
64
+ // CHECK-LABEL: emitc.func private @return_void() attributes {specifiers = ["static"]}
65
+ // CHECK-NEXT: emitc.return
66
+ func.func private @return_void () {
67
+ return
68
+ }
69
+
70
+ // CHECK-LABEL: emitc.func @call()
71
+ // CHECK-NEXT: emitc.call @return_void() : () -> ()
72
+ // CHECK-NEXT: emitc.return
73
+ func.func @call () {
74
+ call @return_void () : () -> ()
75
+ return
76
+ }
You can’t perform that action at this time.
0 commit comments