ProgramBuilder: Generate type pairs for primitives

Emit the new typ::I32, typ::U32, typ::F32, typ::Void, typ::Bool types instead of the just the sem::Types.

Used as a stepping stone to emitting the ast::Types instead.

Bug: tint:724
Change-Id: Ic492e33bc909e0821b581af05242d956631db2e3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48602
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-04-21 13:37:22 +00:00
committed by Commit Bot service account
parent 440636c15c
commit a922e65d72
9 changed files with 68 additions and 50 deletions

View File

@@ -245,7 +245,8 @@ bool Resolver::ResolveInternal() {
for (auto* node : builder_->ASTNodes().Objects()) {
if (marked_.count(node) == 0) {
if (node->IsAnyOf<ast::AccessDecoration, ast::StrideDecoration>()) {
if (node->IsAnyOf<ast::AccessDecoration, ast::StrideDecoration,
ast::Type>()) {
// TODO(crbug.com/tint/724) - Remove once tint:724 is complete.
// ast::AccessDecorations are generated by the WGSL parser, used to
// build sem::AccessControls and then leaked.
@@ -253,6 +254,7 @@ bool Resolver::ResolveInternal() {
// multiple arrays of the same stride, size and element type are
// currently de-duplicated by the type manager, and we leak these
// decorations.
// ast::Types are being built, but not yet being handled. This is WIP.
continue;
}
TINT_ICE(diagnostics_) << "AST node '" << node->TypeInfo().name