mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-11 22:44:04 +00:00
Make ast::StructMember accept typ::Type
A minimal change to get a feel for what updating AST types to accept typ::Type (for now) looks like. Bug: tint:724 Change-Id: I33b33eb6af90e3629f76716a421f952f5a4bc11d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48841 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
05abdf5096
commit
0b9ea91fcf
@@ -24,13 +24,13 @@ namespace ast {
|
||||
StructMember::StructMember(ProgramID program_id,
|
||||
const Source& source,
|
||||
const Symbol& sym,
|
||||
sem::Type* type,
|
||||
typ::Type type,
|
||||
DecorationList decorations)
|
||||
: Base(program_id, source),
|
||||
symbol_(sym),
|
||||
type_(type),
|
||||
decorations_(std::move(decorations)) {
|
||||
TINT_ASSERT(type);
|
||||
TINT_ASSERT(type.sem);
|
||||
TINT_ASSERT(symbol_.IsValid());
|
||||
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(symbol_, program_id);
|
||||
for (auto* deco : decorations_) {
|
||||
@@ -59,7 +59,7 @@ StructMember* StructMember::Clone(CloneContext* ctx) const {
|
||||
// Clone arguments outside of create() call to have deterministic ordering
|
||||
auto src = ctx->Clone(source());
|
||||
auto sym = ctx->Clone(symbol_);
|
||||
auto* ty = ctx->Clone(type_);
|
||||
auto ty = ctx->Clone(type_);
|
||||
auto decos = ctx->Clone(decorations_);
|
||||
return ctx->dst->create<StructMember>(src, sym, ty, decos);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "src/ast/decoration.h"
|
||||
#include "src/typepair.h"
|
||||
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
@@ -35,7 +36,7 @@ class StructMember : public Castable<StructMember, Node> {
|
||||
StructMember(ProgramID program_id,
|
||||
const Source& source,
|
||||
const Symbol& sym,
|
||||
sem::Type* type,
|
||||
typ::Type type,
|
||||
DecorationList decorations);
|
||||
/// Move constructor
|
||||
StructMember(StructMember&&);
|
||||
@@ -44,8 +45,9 @@ class StructMember : public Castable<StructMember, Node> {
|
||||
|
||||
/// @returns the symbol
|
||||
const Symbol& symbol() const { return symbol_; }
|
||||
|
||||
/// @returns the type
|
||||
sem::Type* type() const { return type_; }
|
||||
typ::Type type() const { return type_; }
|
||||
|
||||
/// @returns the decorations
|
||||
const DecorationList& decorations() const { return decorations_; }
|
||||
@@ -73,7 +75,7 @@ class StructMember : public Castable<StructMember, Node> {
|
||||
StructMember(const StructMember&) = delete;
|
||||
|
||||
Symbol const symbol_;
|
||||
sem::Type* const type_;
|
||||
typ::Type const type_;
|
||||
DecorationList const decorations_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user