dawn-cmake/src
Ben Clayton 0b930237ec ast: Clone symbols instead of ever-growing
The interface for cloning a module was made significantly more complex in https://dawn-review.googlesource.com/c/tint/+/35502/ as some of the transforms required constructing symbols before the clone. This was temporary solution in 35502 was to copy the symbol table, then construct the new types, then perform the clone. This lead to a really messy callback interface, that was extremely error prone (e.g. lamda-capturing stack variables from the initializer callback that had been unwound).

Instead, clone the symbols as they're encountered. This may produce an entirely different set of identifiers, but no longer ever-grows the symbol list, and keeps the interface clean.

Bug: tint:396
Bug: tint:390
Change-Id: I54affd68ac3b730b649af9b47eba685c8a1d784a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35663
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-15 12:32:18 +00:00
..
ast ast: Clone symbols instead of ever-growing 2020-12-15 12:32:18 +00:00
diagnostic Rework all transforms to transform-on-copy 2020-12-04 09:06:09 +00:00
inspector Move all Source constructor params to be the first 2020-12-14 21:10:07 +00:00
reader Move all Source constructor params to be the first 2020-12-14 21:10:07 +00:00
transform ast: Clone symbols instead of ever-growing 2020-12-15 12:32:18 +00:00
validator Move all Source constructor params to be the first 2020-12-14 21:10:07 +00:00
writer Start cleaning up tests (2/N) 2020-12-14 22:27:37 +00:00
CMakeLists.txt Start cleaning up tests (3/N) 2020-12-14 22:30:57 +00:00
castable.cc Add ClassID::Unique template and TINT_INSTANTIATE_CLASS_ID 2020-12-02 18:19:28 +00:00
castable.h Castable: Minor tweaks 2020-12-03 17:44:19 +00:00
castable_test.cc Castable: Minor tweaks 2020-12-03 17:44:19 +00:00
demangler.cc Add a demangler 2020-12-11 18:29:03 +00:00
demangler.h Add a demangler 2020-12-11 18:29:03 +00:00
demangler_test.cc Add a demangler 2020-12-11 18:29:03 +00:00
namer.cc Update namer to use symbol table. 2020-12-10 18:40:01 +00:00
namer.h Update namer to use symbol table. 2020-12-10 18:40:01 +00:00
namer_test.cc Update namer to use symbol table. 2020-12-10 18:40:01 +00:00
scope_stack.h Fixup all doxygen tags 2020-12-02 15:31:08 +00:00
scope_stack_test.cc ast: Merge DecoratedVariable into Variable 2020-12-11 13:07:02 +00:00
source.cc Fixup lint errors. 2020-11-03 16:26:09 +00:00
source.h Fixup all doxygen tags 2020-12-02 15:31:08 +00:00
symbol.cc Add a symbol table. 2020-12-10 16:56:02 +00:00
symbol.h Add a symbol table. 2020-12-10 16:56:02 +00:00
symbol_table.cc Add a symbol to the Function AST node. 2020-12-11 18:24:53 +00:00
symbol_table.h Add a symbol to the Function AST node. 2020-12-11 18:24:53 +00:00
symbol_table_test.cc Add a symbol table. 2020-12-10 16:56:02 +00:00
symbol_test.cc Add a symbol table. 2020-12-10 16:56:02 +00:00
type_determiner.cc Add a symbol to the Function AST node. 2020-12-11 18:24:53 +00:00
type_determiner.h Add a symbol to the Function AST node. 2020-12-11 18:24:53 +00:00
type_determiner_test.cc Start cleaning up tests (1/N) 2020-12-14 22:08:27 +00:00