Use ProgramBuilder::Construct() where possible

Replace all calls to create<ast::TypeConstructorExpression>() with
Construct(). TypeConstructorExpression will be folded into
ast::CallExpression, but the Construct() call signature will remain
identical.

Bug: tint:888
Change-Id: Ifb28a90ccf5184c8090c2e32fa8c82f3996dfa33
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/69108
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton
2021-11-12 13:53:49 +00:00
parent 5a40c6564c
commit 4cfa725fb3
7 changed files with 126 additions and 204 deletions

View File

@@ -522,11 +522,11 @@ struct DecomposeMemoryAccess::State {
values.emplace_back(b.Call(load, "buffer", offset));
}
}
b.Func(name, params, CreateASTTypeFor(ctx, el_ty),
{
b.Return(b.create<ast::TypeConstructorExpression>(
CreateASTTypeFor(ctx, el_ty), values)),
});
b.Func(
name, params, CreateASTTypeFor(ctx, el_ty),
{
b.Return(b.Construct(CreateASTTypeFor(ctx, el_ty), values)),
});
}
return name;
});

View File

@@ -715,7 +715,7 @@ struct State {
LoadPrimitive(array_base, primitive_offset, buffer, base_format));
}
return ctx.dst->create<ast::TypeConstructorExpression>(
return ctx.dst->Construct(
ctx.dst->create<ast::Vector>(base_type, count), std::move(expr_list));
}