tint: Use const-expression and override-expression terms

Fixed: tint:1601
Change-Id: I72827df7c83dbb8f5dc69a8803fbe955b1a2421d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105622
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2022-10-13 13:47:39 +00:00
committed by Dawn LUCI CQ
parent 92264f8bb2
commit f10a57908a
18 changed files with 41 additions and 40 deletions

View File

@@ -31,7 +31,7 @@ class GlobalVariable;
namespace tint::sem {
/// The variant of an ArrayCount when the array is a constant expression.
/// The variant of an ArrayCount when the array is a const-expression.
/// Example:
/// ```
/// const N = 123;
@@ -144,7 +144,7 @@ class Array final : public Castable<Array, Type> {
/// @returns the number of elements in the array.
const ArrayCount& Count() const { return count_; }
/// @returns the array count if the count is a constant expression, otherwise returns nullopt.
/// @returns the array count if the count is a const-expression, otherwise returns nullopt.
inline std::optional<uint32_t> ConstantCount() const {
if (auto* count = std::get_if<ConstantArrayCount>(&count_)) {
return count->value;
@@ -175,7 +175,7 @@ class Array final : public Castable<Array, Type> {
/// natural stride
bool IsStrideImplicit() const { return stride_ == implicit_stride_; }
/// @returns true if this array is sized using an constant expression
/// @returns true if this array is sized using an const-expression
bool IsConstantSized() const { return std::holds_alternative<ConstantArrayCount>(count_); }
/// @returns true if this array is sized using an override variable

View File

@@ -40,8 +40,9 @@ class Variable;
namespace tint::sem {
/// WorkgroupSize is a three-dimensional array of WorkgroupDimensions.
/// Each dimension is a std::optional as a workgroup size can be a constant or override expression.
/// Override expressions are not known at compilation time, so these will be std::nullopt.
/// Each dimension is a std::optional as a workgroup size can be a const-expression or
/// override-expression. Override expressions are not known at compilation time, so these will be
/// std::nullopt.
using WorkgroupSize = std::array<std::optional<uint32_t>, 3>;
/// Function holds the semantic information for function nodes.