dawn-cmake/src
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
..
ast [resolver]: Begin constant value evaluation 2021-07-13 12:18:13 +00:00
diagnostic diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
inspector Factor out the InspectorHelper from the Inspector test file 2021-07-13 15:34:45 +00:00
reader reader/wgsl: Reserve ++ and -- tokens 2021-07-13 13:34:15 +00:00
resolver sem: Add CompoundStatement 2021-07-14 09:44:41 +00:00
sem sem: Add CompoundStatement 2021-07-14 09:44:41 +00:00
transform [resolver]: Begin constant value evaluation 2021-07-13 12:18:13 +00:00
utils [utils]: Add TINT_DEFER() 2021-07-08 10:00:17 +00:00
val writer: Move sanitizers into the backends 2021-07-08 16:00:23 +00:00
writer writer: Fix CaseStatment tests 2021-07-13 22:13:11 +00:00
BUILD.gn sem: Add CompoundStatement 2021-07-14 09:44:41 +00:00
CMakeLists.txt sem: Add CompoundStatement 2021-07-14 09:44:41 +00:00
block_allocator.h Remove sem::AccessControl 2021-05-14 17:51:13 +00:00
block_allocator_test.cc Add tint::BlockAllocator<T> 2021-01-21 15:30:10 +00:00
castable.cc Pull Is() out of castable and into a new TypeInfo 2021-03-02 20:30:08 +00:00
castable.h castable.h: Fix warning 2021-04-30 21:27:02 +00:00
castable_test.cc Castable: Add FLAGS template argument for Is,As 2021-04-16 15:05:44 +00:00
clone_context.cc Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
clone_context.h diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
clone_context_test.cc diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
debug.cc diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
debug.h diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
debug_test.cc diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
demangler.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
demangler.h Simplify calls to ast::Node::[to_]str() 2021-01-29 11:22:40 +00:00
demangler_test.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
intrinsic_table.cc diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
intrinsic_table.h src: Reimplement IntrinsicTable from intrisics.def 2021-06-01 19:06:31 +00:00
intrinsic_table.inl [writer/msl]: Implement modf and frexp 2021-07-08 21:21:27 +00:00
intrinsic_table.inl.tmpl intrinsic_table.def: Support [[deprecated]] on fn 2021-06-10 17:31:54 +00:00
intrinsic_table_test.cc intrinsics: textureDimensions for cubes return vec2 2021-06-21 16:44:26 +00:00
intrinsics.def [writer/msl]: Implement modf and frexp 2021-07-08 21:21:27 +00:00
program.cc Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
program.h Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
program_builder.cc validation: compute shader must include 'workgroup_size' in its attributes 2021-06-29 18:39:44 +00:00
program_builder.h Revert "Validate storage class constraints" 2021-07-12 20:15:43 +00:00
program_builder_test.cc Remove typ::TypePair. 2021-05-20 15:10:48 +00:00
program_id.cc Add ProgramID feed it into all ast::Nodes 2021-04-13 23:27:27 +00:00
program_id.h diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
program_test.cc Validate that in/out storage classes are not used 2021-06-24 15:53:26 +00:00
scope_stack.h
scope_stack_test.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
source.cc Resolver: Check that every AST node is reached once 2021-04-19 19:16:12 +00:00
source.h wgsl parser: use new TypesBuilder factory functions, and set Source for ast::Type nodes 2021-04-27 17:32:37 +00:00
symbol.cc diag: Add System enumerator to all diagnostics 2021-06-24 11:27:36 +00:00
symbol.h Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
symbol_table.cc Fix TextGenerator::UniqueIdentifier() failing with empty string arg 2021-06-29 22:07:05 +00:00
symbol_table.h Fix TextGenerator::UniqueIdentifier() failing with empty string arg 2021-06-29 22:07:05 +00:00
symbol_table_test.cc Fix TextGenerator::UniqueIdentifier() failing with empty string arg 2021-06-29 22:07:05 +00:00
symbol_test.cc Validate that Symbols are all part of the same program 2021-04-15 18:20:03 +00:00
test_main.cc test: Remove HLSL & MSL Validate() logic 2021-06-11 13:22:27 +00:00
traits.h Validate function call arguments 2021-06-09 20:17:59 +00:00
traits_test.cc Remove all unnecessary includes 2021-03-09 11:11:17 +00:00