Move function validation from Validator to Resolver

* Fixed many tests that now failed validation. Most of the time,
functions declared that they returned a type, but with no return
statement.
* ProgramBuilder::WrapInFunction now returns the function is creates,
and std::moves its StatementList.
* ProgramBuilder: Added Return function to create ast::ReturnStatements
more easily.

Bug: tint:642
Change-Id: I3011314e66e264ebd7b89bf9271392391be6a0e5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/45382
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano
2021-03-19 14:04:51 +00:00
committed by Commit Bot service account
parent b4f11f3ff3
commit 03c01b5266
20 changed files with 393 additions and 342 deletions

View File

@@ -171,6 +171,7 @@ source_set("tint_unittests_core_src") {
"../src/program_test.cc",
"../src/resolver/assignment_validation_test.cc",
"../src/resolver/decoration_validation_test.cc",
"../src/resolver/function_validation_test.cc",
"../src/resolver/host_shareable_validation_test.cc",
"../src/resolver/intrinsic_test.cc",
"../src/resolver/is_host_shareable_test.cc",