This CL moves the various sem methods in the resolver to a helper class.
Bug: tint:1313
Change-Id: I1f5e77a7864935d44d327b2b8462f931d46977ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87149
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL makes all the validation methods const except for
ValidateSwitch.
Bug: tint:1313
Change-Id: I19ce7beae5ab4591d525dad4dca45f03dd4733b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87148
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL changes ValidateStorageClassLayouts to take the
valid_type_storage_layouts_ as a parameter instead of accessing
directly.
Bug: tint:1313
Change-Id: I2eade6abd9b0acf3d8937c08b0453682be8864fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87147
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL moves the possible call to create the return type out of the
ValidateReturn and into the call. The type is then passed into the
ValidateReturn method.
Bug: tint:1313
Change-Id: I5d2e78b945fc47a14072f503d0478a7da051137d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87146
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
The current_function was used to retrieve the functions return type.
Pass it in directly instead of using current_function.
Bug: tint:1313
Change-Id: Ie29407aecc51e8453460f46437b5c011088c3749
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87145
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
The ValidateFunction method just required the current pipeline stage.
Provide the stage directly instead of using current_function.
Bug: tint:1313
Change-Id: I0c12bef4b28b9cecfbd2b9d7d336a8ff3f8c3a77
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87144
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
The ValidateStructure method only required the current pipeline stage.
Pass that in directly instead of depending on current_function_.
Bug: tint:1313
Change-Id: I13a429aa9d77c8c43fb82d2aa02b25e05b0e3a6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87143
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This PR condenses the namespaces in the tint/resolver folder.
Change-Id: I7ed4d677a3d1dd39a672fc2d4e6721a6a4f6157d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86031
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
These can only be applied to scalar integer references.
These currently cannot be used in a for-loop initializer.
Bug: tint:1488
Change-Id: I218c438c573ff3f5917d058718d12603f9b4057f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86002
Reviewed-by: Ben Clayton <bclayton@google.com>
Reuse the logic for resolving binary operator result types that was
implemented for binary expressions. This validates that the LHS and
RHS are compatible for the target operator. We then try to match the
resolved result type against the LHS store type.
Bug: tint:1325
Change-Id: If80a883079bb71fa6c4eb5545654279fefffacb4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/74362
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This same logic will be used for resolving and validating compound
assignment statements, so pull the core out into a separate function
that decouples it from ast::BinaryExpression.
Bug: tint:1325
Change-Id: Ibdb5a7fc8153dac0dd7f9ae3d5164e23585068cd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/74360
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
E.g. sem info for "f().x" returned false for HasSideEffects().
Bug: tint:1300
Change-Id: I789f75eef834c58a93e07d93c8334635d39981c3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/83100
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>