The error was added to diagnostics_, and then this list was replaced with diagnostics from the builder.
This resulted in the error silently being dropped.
Change-Id: Ifdda99bfb1582fa5d0fa691f7d39cfe3f17e60e5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/39901
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
With the ast::Module::Functions().
Also remove pointless calls to td.Determine() that will automatically be
done when the program is built.
Change-Id: Ia7506e430b04d91d4f6b02fb6b678d0ea9912bcd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/39900
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
By putting diagnostics into the program, we can hold all the diagnostic messages for parsing and type determination in one place.
This also means that we can simplify the public WGSL and SPIR-V Parser interfaces to a single function.
Change-Id: Ib6ab5fa180addd45c4aaf0c6b192d47182ffb50a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38920
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Program is now immutable*, and remains part of the public Tint
interface.
ProgramBuilder is the mutable builder for Programs, and is not part of
the public Tint interface. ast::Builder has been folded into
ProgramBuilder.
Immutable Programs can be cloned into a mutable ProgramBuilder with
Program::CloneAsBuilder().
Mutable ProgramBuilders can be moved into immutable Programs.
* - mostly immutable. It still has a move constructor and move
assignment operator - required for practical usage - and the
semantic information on AST nodes is still mutable.
Bug: tint:390
Change-Id: Ia856c50b1880c2f95c91467a9eef5024cbc380c6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38240
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This builder will be merged into ProgramBuilder, where these will become methods.
To breakup this change, perform the refactoring as a separate change.
Bug: tint:390
Change-Id: I2c9151cd9f198e99d88eaf296dd994293df6c425
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38720
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This is required in order to support move operators for TypesBuilder.
Bug: tint:390
Change-Id: I9667bda5f5be267df092f5cd94dc40db053ae6e2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38555
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Enforce all places where Dawn passes in or returns a ast::Module, now takes a `const Program* ` or returns a `Program`.
As the end goal of all this is to have immutable Programs, all Program inputs take a pointer instead of moving the actual object.
As consumers of a Program are now all const, we have to const_cast to work around all the places we've been incorrectly mutating a ast::Module.
These const_casts are temporary, and will be fixed in the next set of changes.
Depends on https://dawn-review.googlesource.com/c/dawn/+/38522
Bug: tint:390
Change-Id: Ie05b112b16134937d1b601e9b713ea4ec4e1c677
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38541
Reviewed-by: dan sinclair <dsinclair@chromium.org>