| ... | ... | @@ -73,8 +73,6 @@ pub const Regular = struct { |
| 73 | 73 | global, |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | | pub fn deinit(regular: *Regular, allocator: *Allocator) void {} |
| 77 | | |
| 78 | 76 | pub fn isTemp(regular: *Regular) bool { |
| 79 | 77 | if (regular.linkage == .translation_unit) { |
| 80 | 78 | return mem.startsWith(u8, regular.base.name, "l") or mem.startsWith(u8, regular.base.name, "L"); |
| ... | ... | @@ -116,8 +114,6 @@ pub const Unresolved = struct { |
| 116 | 114 | file: *Object, |
| 117 | 115 | |
| 118 | 116 | pub const base_type: Symbol.Type = .unresolved; |
| 119 | | |
| 120 | | pub fn deinit(unresolved: *Unresolved, allocator: *Allocator) void {} |
| 121 | 117 | }; |
| 122 | 118 | |
| 123 | 119 | pub const Tentative = struct { |
| ... | ... | @@ -133,17 +129,13 @@ pub const Tentative = struct { |
| 133 | 129 | file: *Object, |
| 134 | 130 | |
| 135 | 131 | pub const base_type: Symbol.Type = .tentative; |
| 136 | | |
| 137 | | pub fn deinit(tentative: *Tentative, allocator: *Allocator) void {} |
| 138 | 132 | }; |
| 139 | 133 | |
| 140 | 134 | pub fn deinit(base: *Symbol, allocator: *Allocator) void { |
| 141 | 135 | allocator.free(base.name); |
| 142 | 136 | switch (base.@"type") { |
| 143 | | .regular => @fieldParentPtr(Regular, "base", base).deinit(allocator), |
| 144 | 137 | .proxy => @fieldParentPtr(Proxy, "base", base).deinit(allocator), |
| 145 | | .unresolved => @fieldParentPtr(Unresolved, "base", base).deinit(allocator), |
| 146 | | .tentative => @fieldParentPtr(Tentative, "base", base).deinit(allocator), |
| 138 | else => {}, |
| 147 | 139 | } |
| 148 | 140 | } |
| 149 | 141 | |