mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
ast: Move [Set]IsSwizzle() from IdentifierExpression to MemberAccessorExpression
This is more a property of a MemberAccessorExpression than the identifier itself. Change-Id: Icb17df1fe43a959332d73df026e77ca4e07d23ed Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/40140 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
a568701d61
commit
ea9c86c296
@@ -39,12 +39,6 @@ class IdentifierExpression : public Castable<IdentifierExpression, Expression> {
|
||||
/// @returns the symbol for the identifier
|
||||
Symbol symbol() const { return sym_; }
|
||||
|
||||
/// 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
|
||||
@@ -68,8 +62,6 @@ class IdentifierExpression : public Castable<IdentifierExpression, Expression> {
|
||||
IdentifierExpression(const IdentifierExpression&) = delete;
|
||||
|
||||
Symbol const sym_;
|
||||
|
||||
bool is_swizzle_ = false; // Semantic info
|
||||
};
|
||||
|
||||
} // namespace ast
|
||||
|
||||
@@ -45,6 +45,12 @@ 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
|
||||
@@ -69,6 +75,8 @@ class MemberAccessorExpression
|
||||
|
||||
Expression* const struct_;
|
||||
IdentifierExpression* const member_;
|
||||
|
||||
bool is_swizzle_ = false; // Semantic info
|
||||
};
|
||||
|
||||
} // namespace ast
|
||||
|
||||
Reference in New Issue
Block a user