Antonio Maiorano 2543686412 Resolver: compute canonical types and store them as semantic::Variable::Type
We define the canonical type as a type stripped of all aliases. For
example, Canonical(alias<alias<vec3<alias<f32>>>>) is vec3<f32>. This
change adds Resolver::Canonical(Type*) which caches and returns the
resulting canonical type. We use this throughout the Resolver instead of
UnwrapAliasIfNeeded(), and we store the result in semantic::Variable,
returned from it's Type() member function.

Also:

* Wrote unit tests for Resolver::Canonical()

* Added semantic::Variable::DeclaredType() as a convenience to
retrieve the AST variable's type.

* Updated post-resolve code (transforms) to make use of Type and
DeclaredType appropriately, removing unnecessary calls to
UnwrapAliasIfNeeded.

* Added IntrinsicTableTest.MatchWithNestedAliasUnwrapping to ensure we
don't need to pass canonical parameter types for instrinsic table
lookups.

* ProgramBuilder: added vecN and matMxN overloads that take a Type* arg
to create them with alias types.

Bug: tint:705
Change-Id: I58a3b62538356b8dad2b1161a19b38bcefdd5d62
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47360
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2021-04-13 13:32:33 +00:00
..
2021-03-15 10:43:11 +00:00
2021-03-09 11:11:17 +00:00
2021-03-15 10:43:11 +00:00
2021-04-07 08:09:01 +00:00
2021-03-22 19:27:06 +00:00
2021-01-29 15:17:30 +00:00
2021-03-15 10:43:11 +00:00
2021-03-02 20:51:18 +00:00
2021-01-29 10:55:40 +00:00
2021-03-22 19:27:06 +00:00
2021-03-02 20:51:18 +00:00
2021-04-07 08:35:31 +00:00
2021-04-07 08:35:31 +00:00