dawn-cmake/docs
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
..
arch.md Rename semantic to sem 2021-04-16 19:07:51 +00:00
compound_statements.md sem: Add CompoundStatement 2021-07-14 09:44:41 +00:00
diagnostics_guide.md docs: Relax don't-quote-source rule 2021-06-09 07:48:38 +00:00
experimental_extensions.md Proposed process for experimental extensions 2021-04-27 17:55:07 +00:00
spirv-input-output-variables.md spirv-reader: builtin in/out keep their signedness as private vars 2021-06-11 20:45:06 +00:00
spirv-ptr-ref.md Add SPIR-V translation scheme for ptr-ref 2021-05-13 16:37:12 +00:00
style_guide.md Add a style guide 2021-04-08 15:10:47 +00:00
translations.md Remove references 1D Array texture dimension 2021-02-24 05:05:21 +00:00