mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
ast: Remove ReturnStatement constructors that don't take a source
set_source() will be removed, so sources will only be specifiable at construction time. Bug: tint:390 Change-Id: I2b81929e362ccf75145ebc45028dd973a77ae068 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35010 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
321e5a9d7e
commit
d0dda258cc
@@ -2374,11 +2374,11 @@ bool FunctionEmitter::EmitNormalTerminator(const BlockInfo& block_info) {
|
||||
const auto& terminator = *(block_info.basic_block->terminator());
|
||||
switch (terminator.opcode()) {
|
||||
case SpvOpReturn:
|
||||
AddStatement(create<ast::ReturnStatement>());
|
||||
AddStatement(create<ast::ReturnStatement>(Source{}));
|
||||
return true;
|
||||
case SpvOpReturnValue: {
|
||||
auto value = MakeExpression(terminator.GetSingleWordInOperand(0));
|
||||
AddStatement(create<ast::ReturnStatement>(value.expr));
|
||||
AddStatement(create<ast::ReturnStatement>(Source{}, value.expr));
|
||||
}
|
||||
return true;
|
||||
case SpvOpKill:
|
||||
@@ -2392,11 +2392,11 @@ bool FunctionEmitter::EmitNormalTerminator(const BlockInfo& block_info) {
|
||||
{
|
||||
const auto* result_type = type_mgr_->GetType(function_.type_id());
|
||||
if (result_type->AsVoid() != nullptr) {
|
||||
AddStatement(create<ast::ReturnStatement>());
|
||||
AddStatement(create<ast::ReturnStatement>(Source{}));
|
||||
} else {
|
||||
auto* ast_type = parser_impl_.ConvertType(function_.type_id());
|
||||
AddStatement(create<ast::ReturnStatement>(
|
||||
parser_impl_.MakeNullValue(ast_type)));
|
||||
Source{}, parser_impl_.MakeNullValue(ast_type)));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user