@@ -187,41 +187,45 @@ class Builder {
187187 ret->condition = condition;
188188 return ret;
189189 }
190- Call* makeCall (Name target, const std::vector<Expression*>& args, Type type) {
190+ Call* makeCall (Name target,
191+ const std::vector<Expression*>& args,
192+ Type type,
193+ bool isReturn = false ) {
191194 auto * call = allocator.alloc <Call>();
192195 // not all functions may exist yet, so type must be provided
193196 call->type = type;
194197 call->target = target;
195198 call->operands .set (args);
199+ call->isReturn = isReturn;
196200 return call;
197201 }
198- template <typename T> Call* makeCall (Name target, const T& args, Type type) {
202+ template <typename T>
203+ Call* makeCall (Name target, const T& args, Type type, bool isReturn = false ) {
199204 auto * call = allocator.alloc <Call>();
200205 // not all functions may exist yet, so type must be provided
201206 call->type = type;
202207 call->target = target;
203208 call->operands .set (args);
209+ call->isReturn = isReturn;
204210 return call;
205211 }
206212 CallIndirect* makeCallIndirect (FunctionType* type,
207213 Expression* target,
208- const std::vector<Expression*>& args) {
209- auto * call = allocator.alloc <CallIndirect>();
210- call->fullType = type->name ;
211- call->type = type->result ;
212- call->target = target;
213- call->operands .set (args);
214- return call;
214+ const std::vector<Expression*>& args,
215+ bool isReturn = false ) {
216+ return makeCallIndirect (type->name , target, args, type->result , isReturn);
215217 }
216218 CallIndirect* makeCallIndirect (Name fullType,
217219 Expression* target,
218220 const std::vector<Expression*>& args,
219- Type type) {
221+ Type type,
222+ bool isReturn = false ) {
220223 auto * call = allocator.alloc <CallIndirect>();
221224 call->fullType = fullType;
222225 call->type = type;
223226 call->target = target;
224227 call->operands .set (args);
228+ call->isReturn = isReturn;
225229 return call;
226230 }
227231 // FunctionType
0 commit comments