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 <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
dan sinclair 2022-10-24 19:43:28 +00:00 committed by Dawn LUCI CQ
parent cc9ae5cae3
commit a3325fa94d
2 changed files with 4 additions and 1 deletions

View File

@ -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) {

View File

@ -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_());