From bdeee03c0115e28ac706cdc7e5963c528b3b3bf3 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 3 Oct 2022 20:48:59 +0000 Subject: [PATCH] Remove unused Resolver::BlockInfo The BlockInfo structure is not used in the resolver anymore. Removed. Bug: tint:1313 Change-Id: Ie2fd2f5e4d473d1b113a2a65f79d2080f5bb6ab1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104460 Auto-Submit: Dan Sinclair Reviewed-by: Ben Clayton Commit-Queue: Ben Clayton --- src/tint/resolver/resolver.h | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/tint/resolver/resolver.h b/src/tint/resolver/resolver.h index cb95d0cae8..068fb5d1bd 100644 --- a/src/tint/resolver/resolver.h +++ b/src/tint/resolver/resolver.h @@ -113,39 +113,6 @@ class Resolver { private: Validator::ValidTypeStorageLayouts valid_type_storage_layouts_; - /// Structure holding semantic information about a block (i.e. scope), such as - /// parent block and variables declared in the block. - /// Used to validate variable scoping rules. - struct BlockInfo { - enum class Type { kGeneric, kLoop, kLoopContinuing, kSwitchCase }; - - BlockInfo(const ast::BlockStatement* block, Type type, BlockInfo* parent); - ~BlockInfo(); - - template - BlockInfo* FindFirstParent(Pred&& pred) { - BlockInfo* curr = this; - while (curr && !pred(curr)) { - curr = curr->parent; - } - return curr; - } - - BlockInfo* FindFirstParent(BlockInfo::Type ty) { - return FindFirstParent([ty](auto* block_info) { return block_info->type == ty; }); - } - - ast::BlockStatement const* const block; - const Type type; - BlockInfo* const parent; - std::vector decls; - - // first_continue is set to the index of the first variable in decls - // declared after the first continue statement in a loop block, if any. - constexpr static size_t kNoContinue = size_t(~0); - size_t first_continue = kNoContinue; - }; - // Structure holding information for a TypeDecl struct TypeDeclInfo { ast::TypeDecl const* const ast;