Have TypesBuilder vector and matrix methods return ast types

Bug: tint:724
Change-Id: I7bf0d36572ff332e1ecc606f2aa61414a6d74377
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51664
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
diff --git a/src/program_builder.h b/src/program_builder.h
index 8313c57..80791c8 100644
--- a/src/program_builder.h
+++ b/src/program_builder.h
@@ -404,8 +404,7 @@
     /// @return the tint AST type for a `n`-element vector of `type`.
     typ::Vector vec(typ::Type type, uint32_t n) const {
       type = MaybeCreateTypename(type);
-      return {type.ast ? builder->create<ast::Vector>(type, n) : nullptr,
-              type.sem ? builder->create<sem::Vector>(type, n) : nullptr};
+      return {builder->create<ast::Vector>(type, n)};
     }
 
     /// @param source the Source of the node
@@ -414,9 +413,7 @@
     /// @return the tint AST type for a `n`-element vector of `type`.
     typ::Vector vec(const Source& source, typ::Type type, uint32_t n) const {
       type = MaybeCreateTypename(type);
-      return {
-          type.ast ? builder->create<ast::Vector>(source, type, n) : nullptr,
-          type.sem ? builder->create<sem::Vector>(type, n) : nullptr};
+      return {builder->create<ast::Vector>(source, type, n)};
     }
 
     /// @param type vector subtype
@@ -462,10 +459,7 @@
     /// @return the tint AST type for a matrix of `type`
     typ::Matrix mat(typ::Type type, uint32_t columns, uint32_t rows) const {
       type = MaybeCreateTypename(type);
-      return {type.ast ? builder->create<ast::Matrix>(type, rows, columns)
-                       : nullptr,
-              type.sem ? builder->create<sem::Matrix>(vec(type, rows), columns)
-                       : nullptr};
+      return {builder->create<ast::Matrix>(type, rows, columns)};
     }
 
     /// @param source the Source of the node
@@ -477,11 +471,7 @@
                     typ::Type type,
                     uint32_t columns,
                     uint32_t rows) const {
-      return {type.ast
-                  ? builder->create<ast::Matrix>(source, type, rows, columns)
-                  : nullptr,
-              type.sem ? builder->create<sem::Matrix>(vec(type, rows), columns)
-                       : nullptr};
+      return {builder->create<ast::Matrix>(source, type, rows, columns)};
     }
 
     /// @param type matrix subtype
diff --git a/src/typepair.h b/src/typepair.h
index 31c3c50..487482d 100644
--- a/src/typepair.h
+++ b/src/typepair.h
@@ -237,10 +237,8 @@
 
 using Type = TypePair<ast::Type, sem::Type>;
 
-using Matrix = TypePair<ast::Matrix, sem::Matrix>;
 using Pointer = TypePair<ast::Pointer, sem::Pointer>;
 using Struct = TypePair<ast::Struct, sem::Struct>;
-using Vector = TypePair<ast::Vector, sem::Vector>;
 
 using Bool = Ptr<ast::Bool>;
 using U32 = Ptr<ast::U32>;
@@ -254,6 +252,8 @@
 using StorageTexture = Ptr<ast::StorageTexture>;
 using Texture = Ptr<ast::Texture>;
 using Sampler = Ptr<ast::Sampler>;
+using Matrix = Ptr<ast::Matrix>;
+using Vector = Ptr<ast::Vector>;
 
 // Helpers