Replace Expression::(Is|As)* with Castable

Change-Id: I6ab98ed8b198f1b3b42ce1f09a6c4f992d65fe95
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34316
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2020-11-30 23:30:58 +00:00
parent 1d8098ae94
commit d6ae990811
64 changed files with 651 additions and 863 deletions

View File

@@ -124,13 +124,13 @@ std::map<uint32_t, Scalar> Inspector::GetConstantIDs() {
}
auto* expression = var->constructor();
if (!expression->IsConstructor()) {
if (!expression->Is<ast::ConstructorExpression>()) {
// This is invalid WGSL, but handling gracefully.
result[constant_id] = Scalar();
continue;
}
auto* constructor = expression->AsConstructor();
auto* constructor = expression->As<ast::ConstructorExpression>();
if (!constructor->IsScalarConstructor()) {
// This is invalid WGSL, but handling gracefully.
result[constant_id] = Scalar();