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 <dsinclair@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
6f39b6c416
commit
bdeee03c01
|
@ -113,39 +113,6 @@ class Resolver {
|
||||||
private:
|
private:
|
||||||
Validator::ValidTypeStorageLayouts valid_type_storage_layouts_;
|
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 <typename Pred>
|
|
||||||
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<const ast::Variable*> 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
|
// Structure holding information for a TypeDecl
|
||||||
struct TypeDeclInfo {
|
struct TypeDeclInfo {
|
||||||
ast::TypeDecl const* const ast;
|
ast::TypeDecl const* const ast;
|
||||||
|
|
Loading…
Reference in New Issue