diff --git a/src/tint/reader/spirv/function.cc b/src/tint/reader/spirv/function.cc index 052d186538..5592f1cf07 100644 --- a/src/tint/reader/spirv/function.cc +++ b/src/tint/reader/spirv/function.cc @@ -1392,7 +1392,7 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { return_type = builder_.ty.Of(str); // Add the return-value statement. - stmts.Push(create( + stmts.Push(builder_.Return( source, builder_.Call(source, return_type, std::move(return_exprs)))); } } @@ -3124,14 +3124,14 @@ bool FunctionEmitter::EmitNormalTerminator(const BlockInfo& block_info) { const auto& terminator = *(block_info.basic_block->terminator()); switch (opcode(terminator)) { case spv::Op::OpReturn: - AddStatement(create(Source{})); + AddStatement(builder_.Return(Source{})); return true; case spv::Op::OpReturnValue: { auto value = MakeExpression(terminator.GetSingleWordInOperand(0)); if (!value) { return false; } - AddStatement(create(Source{}, value.expr)); + AddStatement(builder_.Return(Source{}, value.expr)); return true; } case spv::Op::OpKill: @@ -3145,11 +3145,10 @@ bool FunctionEmitter::EmitNormalTerminator(const BlockInfo& block_info) { { const auto* result_type = type_mgr_->GetType(function_.type_id()); if (result_type->AsVoid() != nullptr) { - AddStatement(create(Source{})); + AddStatement(builder_.Return(Source{})); } else { auto* ast_type = parser_impl_.ConvertType(function_.type_id()); - AddStatement(create( - Source{}, parser_impl_.MakeNullValue(ast_type))); + AddStatement(builder_.Return(Source{}, parser_impl_.MakeNullValue(ast_type))); } } return true; diff --git a/src/tint/reader/wgsl/parser_impl.cc b/src/tint/reader/wgsl/parser_impl.cc index dfe57fd808..c72db34568 100644 --- a/src/tint/reader/wgsl/parser_impl.cc +++ b/src/tint/reader/wgsl/parser_impl.cc @@ -1904,7 +1904,7 @@ Maybe ParserImpl::return_statement() { } if (peek_is(Token::Type::kSemicolon)) { - return create(source, nullptr); + return builder_.Return(source, nullptr); } auto expr = expression(); @@ -1913,7 +1913,7 @@ Maybe ParserImpl::return_statement() { } // TODO(bclayton): Check matched? - return create(source, expr.value); + return builder_.Return(source, expr.value); } // variable_statement