From a3325fa94d446f14963985235e08124e950d08b6 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 24 Oct 2022 19:43:28 +0000 Subject: [PATCH] Traverse function return attributes. The dependency graph needs to traverse function return attributes as they can contain expressions now. Bug: chromium:1377630 Change-Id: I338aa7ff1105baed93871ec44ca02285fabf407d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106845 Reviewed-by: Ben Clayton Commit-Queue: Dan Sinclair Auto-Submit: Dan Sinclair Kokoro: Kokoro --- src/tint/resolver/dependency_graph.cc | 1 + src/tint/resolver/dependency_graph_test.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tint/resolver/dependency_graph.cc b/src/tint/resolver/dependency_graph.cc index b6001c1fa4..5a21c55d8a 100644 --- a/src/tint/resolver/dependency_graph.cc +++ b/src/tint/resolver/dependency_graph.cc @@ -194,6 +194,7 @@ class DependencyScanner { [&](const ast::Function* func) { Declare(func->symbol, func); TraverseAttributes(func->attributes); + TraverseAttributes(func->return_type_attributes); TraverseFunction(func); }, [&](const ast::Variable* var) { diff --git a/src/tint/resolver/dependency_graph_test.cc b/src/tint/resolver/dependency_graph_test.cc index ae314b8a95..311c9ccc66 100644 --- a/src/tint/resolver/dependency_graph_test.cc +++ b/src/tint/resolver/dependency_graph_test.cc @@ -1270,7 +1270,9 @@ TEST_F(ResolverDependencyGraphTraversalTest, SymbolsReached) { Return(V), // Break(), // Discard(), // - }); // + }, + utils::Empty, // function attributes + utils::Vector{Location(V)}); // return attributes // Exercise type traversal GlobalVar(Sym(), ty.atomic(T)); GlobalVar(Sym(), ty.bool_());