Rename Constant::As to Constant::ValueAs.

This CL updates Constant::As to be Constant::ValueAs. Now that Constant
inherits from CastableBase, there is already an As method on
CastableBase. This makes the override inside Constant confusing and
potentially incorrect.

Bug: tint:1718
Change-Id: I4f73971801e95225a99a5a993124c04194d0d7d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114360
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2022-12-14 20:46:32 +00:00
committed by Dawn LUCI CQ
parent 35842190ef
commit 5addefb148
20 changed files with 401 additions and 401 deletions

View File

@@ -559,7 +559,7 @@ struct DirectVariableAccess::State {
const ast::Expression* BuildDynamicIndex(const sem::Expression* idx, bool cast_to_u32) {
if (auto* val = idx->ConstantValue()) {
// Expression evaluated to a constant value. Just emit that constant.
return b.Expr(val->As<AInt>());
return b.Expr(val->ValueAs<AInt>());
}
// Expression is not a constant, clone the expression.