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