Replace FunctionDecoration::(Is|As)Stage with Castable

Change-Id: Iecb683c4bee29952d5f08d92533918f65e342158
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34311
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2020-11-30 23:30:58 +00:00
parent c24ac2720d
commit 75828dbaee
10 changed files with 18 additions and 35 deletions

View File

@@ -259,8 +259,9 @@ TEST_F(ParserImplTest, FunctionDecoration_Stage) {
ASSERT_FALSE(p->has_error());
auto* func_deco = deco.value->As<ast::FunctionDecoration>();
ASSERT_NE(func_deco, nullptr);
ASSERT_TRUE(func_deco->IsStage());
EXPECT_EQ(func_deco->AsStage()->value(), ast::PipelineStage::kCompute);
ASSERT_TRUE(func_deco->Is<ast::StageDecoration>());
EXPECT_EQ(func_deco->As<ast::StageDecoration>()->value(),
ast::PipelineStage::kCompute);
}
TEST_F(ParserImplTest, FunctionDecoration_Stage_MissingValue) {