Add semantic::MemberAccessorExpression, use it.

Pull the mutable 'is_swizzled' semantic field from ast::MemberAccessorExpression and into a new semantic::MemberAccessorExpression node.
Have the TypeDeterminer create these semantic::MemberAccessorExpression nodes.

Bug: tint:390
Change-Id: I8fc6e36dabb417190528536a94d027af54059222
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/40142
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-02-03 23:55:56 +00:00
committed by Commit Bot service account
parent df629c5404
commit c1052a4971
9 changed files with 87 additions and 12 deletions

View File

@@ -45,12 +45,6 @@ class MemberAccessorExpression
/// @returns the member expression
IdentifierExpression* member() const { return member_; }
/// Sets the identifier as a swizzle
void SetIsSwizzle() { is_swizzle_ = true; }
/// @returns true if this is a swizzle identifier
bool IsSwizzle() const { return is_swizzle_; }
/// Clones this node and all transitive child nodes using the `CloneContext`
/// `ctx`.
/// @note Semantic information such as resolved expression type and intrinsic
@@ -75,8 +69,6 @@ class MemberAccessorExpression
Expression* const struct_;
IdentifierExpression* const member_;
bool is_swizzle_ = false; // Semantic info
};
} // namespace ast