mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
ast: Add type nodes
Copy all of the type classes from src/type into ast. Required the merging of: * type::Struct into the existing ast::Struct - ast::Struct now has a name. * type::AccessControl into the existing ast::AccessControl enumerator - The old ast::AccessControl enumerator is now ast::AccessControl::Access Bug: tint:724 Change-Id: Ibb950036ed551ec769c6d3d2c8fb411809cf6931 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48383 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:
committed by
Commit Bot service account
parent
ba6f260629
commit
8a8d26bbd9
@@ -535,7 +535,7 @@ class ProgramBuilder {
|
||||
/// @param access the access control
|
||||
/// @param type the inner type
|
||||
/// @returns the access control qualifier type
|
||||
sem::AccessControl* access(ast::AccessControl access,
|
||||
sem::AccessControl* access(ast::AccessControl::Access access,
|
||||
sem::Type* type) const {
|
||||
return builder->create<sem::AccessControl>(access, type);
|
||||
}
|
||||
@@ -1185,9 +1185,10 @@ class ProgramBuilder {
|
||||
NAME&& name,
|
||||
ast::StructMemberList members,
|
||||
ast::DecorationList decorations = {}) {
|
||||
auto* impl =
|
||||
create<ast::Struct>(source, std::move(members), std::move(decorations));
|
||||
auto* type = ty.struct_(Sym(std::forward<NAME>(name)), impl);
|
||||
auto sym = Sym(std::forward<NAME>(name));
|
||||
auto* impl = create<ast::Struct>(source, sym, std::move(members),
|
||||
std::move(decorations));
|
||||
auto* type = ty.struct_(sym, impl);
|
||||
AST().AddConstructedType(type);
|
||||
return type;
|
||||
}
|
||||
@@ -1202,9 +1203,10 @@ class ProgramBuilder {
|
||||
sem::StructType* Structure(NAME&& name,
|
||||
ast::StructMemberList members,
|
||||
ast::DecorationList decorations = {}) {
|
||||
auto sym = Sym(std::forward<NAME>(name));
|
||||
auto* impl =
|
||||
create<ast::Struct>(std::move(members), std::move(decorations));
|
||||
auto* type = ty.struct_(Sym(std::forward<NAME>(name)), impl);
|
||||
create<ast::Struct>(sym, std::move(members), std::move(decorations));
|
||||
auto* type = ty.struct_(sym, impl);
|
||||
AST().AddConstructedType(type);
|
||||
return type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user