mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
Move all Source constructor params to be the first
This consistency can be utilized by the ast::Builder to inject the source parameter if it isn't provided. Bug: tint:396 Bug: tint:390 Change-Id: I2f19002131e79daae799b8cbe918eb192d6bfc75 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35503 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
7b2f8d010f
commit
5aad70a069
@@ -60,7 +60,7 @@ TEST_F(ValidateFunctionTest, VoidFunctionEndWithoutReturnStatement_Pass) {
|
||||
Source{Source::Location{12, 34}}, mod()->RegisterSymbol("func"), "func",
|
||||
params, &void_type, body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
mod()->AddFunction(func);
|
||||
|
||||
@@ -79,7 +79,7 @@ TEST_F(ValidateFunctionTest,
|
||||
params, &void_type,
|
||||
create<ast::BlockStatement>(Source{}, ast::StatementList{}),
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
mod()->AddFunction(func);
|
||||
|
||||
@@ -149,7 +149,7 @@ TEST_F(ValidateFunctionTest, FunctionTypeMustMatchReturnStatementType_Pass) {
|
||||
auto* func = create<ast::Function>(
|
||||
Source{}, mod()->RegisterSymbol("func"), "func", params, &void_type, body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
mod()->AddFunction(func);
|
||||
|
||||
@@ -329,7 +329,7 @@ TEST_F(ValidateFunctionTest, Function_WithPipelineStage_NotVoid_Fail) {
|
||||
Source{Source::Location{12, 34}}, mod()->RegisterSymbol("vtx_main"),
|
||||
"vtx_main", params, &i32, body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
|
||||
mod()->AddFunction(func);
|
||||
@@ -361,7 +361,7 @@ TEST_F(ValidateFunctionTest, Function_WithPipelineStage_WithParams_Fail) {
|
||||
Source{Source::Location{12, 34}}, mod()->RegisterSymbol("vtx_func"),
|
||||
"vtx_func", params, &void_type, body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
|
||||
mod()->AddFunction(func);
|
||||
@@ -386,8 +386,8 @@ TEST_F(ValidateFunctionTest, PipelineStage_MustBeUnique_Fail) {
|
||||
Source{Source::Location{12, 34}}, mod()->RegisterSymbol("main"), "main",
|
||||
params, &void_type, body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kFragment, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kFragment),
|
||||
});
|
||||
|
||||
mod()->AddFunction(func);
|
||||
@@ -411,7 +411,7 @@ TEST_F(ValidateFunctionTest, OnePipelineStageFunctionMustBePresent_Pass) {
|
||||
Source{}, mod()->RegisterSymbol("vtx_func"), "vtx_func", params,
|
||||
&void_type, body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
mod()->AddFunction(func);
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ TEST_F(ValidatorTest, UsingUndefinedVariableGlobalVariable_Pass) {
|
||||
Source{}, mod()->RegisterSymbol("my_func"), "my_func", params, &void_type,
|
||||
body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
mod()->AddFunction(func);
|
||||
|
||||
@@ -848,7 +848,7 @@ TEST_F(ValidatorTest, RedeclaredIdentifierDifferentFunctions_Pass) {
|
||||
Source{}, mod()->RegisterSymbol("func1"), "func1", params1, &void_type,
|
||||
body1,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
|
||||
mod()->AddFunction(func0);
|
||||
|
||||
@@ -211,7 +211,7 @@ TEST_F(ValidatorTypeTest, RuntimeArrayInFunction_Fail) {
|
||||
auto* func = create<ast::Function>(
|
||||
Source{}, mod()->RegisterSymbol("func"), "func", params, &void_type, body,
|
||||
ast::FunctionDecorationList{
|
||||
create<ast::StageDecoration>(ast::PipelineStage::kVertex, Source{}),
|
||||
create<ast::StageDecoration>(Source{}, ast::PipelineStage::kVertex),
|
||||
});
|
||||
mod()->AddFunction(func);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user