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

Change-Id: I18e9768fef36b79cb0e65c6eb79fd147013c54f0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34317
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2020-11-30 23:30:58 +00:00
parent d6ae990811
commit 19fe07236e
15 changed files with 26 additions and 72 deletions

View File

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