dawn-cmake/test
Ben Clayton 6e459fecb7 sem: Add CompoundStatement
This change introduces sem::CompoundStatement, a new base class for
statements that can hold other statements.

sem::BlockStatements now derives from sem::CompoundStatement, and
this change introduces the following new CompoundStatements:
* `sem::IfStatement`
* `sem::ElseStatement`
* `sem::ForLoopStatement`
* `sem::LoopStatement`
* `sem::SwitchStatement`.
These new CompoundStatements are now inserted into the semantic
tree as now documented in `docs/compound_statements.md`.

The `sem::BlockStatement::FindFirstParent()` methods have been
moved down to `sem::Statement`.

The `Resolver::BlockScope()` method has been replaced with
`Resolver::Scope()` which now maintains the `current_statement_`,
`current_compound_statement_ ` and `current_block_`. This
simplifies statement nesting.

The most significant change in behavior is that statements now
always have a parent, so calling Block() on the initializer or
continuing of a for-loop statement will now return the
BlockStatement that holds the for-loop. Before this would
return nullptr.

Fixed: tint:979
Change-Id: I90e38fd719da2a281ed9210e975ab96171cb6842
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57707
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2021-07-14 09:44:41 +00:00
..
access validation: compute shader must include 'workgroup_size' in its attributes 2021-06-29 18:39:44 +00:00
array writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
buffer writer/hlsl: Simplify UBO accesses for static indexing 2021-07-13 12:18:13 +00:00
bug Add test case for tint:219 2021-07-13 16:41:56 +00:00
expressions Revert "writer/hlsl: Special case negative zero" 2021-07-08 16:49:33 +00:00
fxc_bugs/vector_assignment_in_loop reader/wgsl: Generate ForLoopStatements 2021-07-08 21:23:33 +00:00
intrinsics Revert "Validate storage class constraints" 2021-07-12 20:15:43 +00:00
loops test: Add loop test cases 2021-06-21 19:04:56 +00:00
ptr_ref writer/hlsl: Simplify UBO accesses for static indexing 2021-07-13 12:18:13 +00:00
samples writer/hlsl: Simplify UBO accesses for static indexing 2021-07-13 12:18:13 +00:00
shader_io writer/hlsl: Implement invariant attribute 2021-07-13 12:29:26 +00:00
statements/for reader/wgsl: Generate ForLoopStatements 2021-07-08 21:23:33 +00:00
struct writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
types writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
var writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
BUILD.gn sem: Add CompoundStatement 2021-07-14 09:44:41 +00:00
extract-spvasm.py Add --dump-spirv option to tint_unittests 2021-05-05 09:46:31 +00:00
test-all.sh main: Replace --dawn-validation with --validate 2021-06-02 21:02:34 +00:00