From 731c35f15a1469c9523b71476f1e069d5bcfd979 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 17 May 2021 15:35:24 -0700 Subject: stage2: get rid of NameHash Previously, stage2 used a global decl_table for all Decl objects, keyed by a 16-byte name hash that was hopefully unique. Now, there is a tree of Namespace objects that own their named Decl objects. --- src/Module.zig | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index afa29d65fd..54a3c86aed 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -798,8 +798,6 @@ pub const Var = struct { pub const Scope = struct { tag: Tag, - pub const NameHash = [16]u8; - pub fn cast(base: *Scope, comptime T: type) ?*T { if (base.tag != T.base_tag) return null; @@ -839,7 +837,6 @@ pub const Scope = struct { .namespace => return @fieldParentPtr(Namespace, "base", base).file_scope.sub_file_path, .file => return @fieldParentPtr(File, "base", base).sub_file_path, .block => unreachable, - .decl_ref => unreachable, } } @@ -861,10 +858,6 @@ pub const Scope = struct { /// Namespace owned by structs, enums, unions, and opaques for decls. namespace, block, - /// Used for simple error reporting. Only contains a reference to a - /// `Decl` for use with `srcDecl` and `ownerDecl`. - /// Has no parents or children. - decl_ref, }; /// The container that structs, enums, unions, and opaques have. -- cgit v1.2.3