| ... | @@ -125,14 +125,13 @@ pub const File = struct { | ... | @@ -125,14 +125,13 @@ pub const File = struct { |
| 125 | switch (base.tag) { | 125 | switch (base.tag) { |
| 126 | .Elf => return @fieldParentPtr(Elf, "base", base).makeWritable(dir, sub_path), | 126 | .Elf => return @fieldParentPtr(Elf, "base", base).makeWritable(dir, sub_path), |
| 127 | .C => {}, | 127 | .C => {}, |
| 128 | else => unreachable, | | |
| 129 | } | 128 | } |
| 130 | } | 129 | } |
| 131 | | 130 | |
| 132 | pub fn makeExecutable(base: *File) !void { | 131 | pub fn makeExecutable(base: *File) !void { |
| 133 | switch (base.tag) { | 132 | switch (base.tag) { |
| 134 | .Elf => return @fieldParentPtr(Elf, "base", base).makeExecutable(), | 133 | .Elf => return @fieldParentPtr(Elf, "base", base).makeExecutable(), |
| 135 | else => unreachable, | 134 | .C => unreachable, |
| 136 | } | 135 | } |
| 137 | } | 136 | } |
| 138 | | 137 | |
| ... | @@ -140,7 +139,6 @@ pub const File = struct { | ... | @@ -140,7 +139,6 @@ pub const File = struct { |
| 140 | switch (base.tag) { | 139 | switch (base.tag) { |
| 141 | .Elf => return @fieldParentPtr(Elf, "base", base).updateDecl(module, decl), | 140 | .Elf => return @fieldParentPtr(Elf, "base", base).updateDecl(module, decl), |
| 142 | .C => return @fieldParentPtr(C, "base", base).updateDecl(module, decl), | 141 | .C => return @fieldParentPtr(C, "base", base).updateDecl(module, decl), |
| 143 | else => unreachable, | | |
| 144 | } | 142 | } |
| 145 | } | 143 | } |
| 146 | | 144 | |
| ... | @@ -148,7 +146,6 @@ pub const File = struct { | ... | @@ -148,7 +146,6 @@ pub const File = struct { |
| 148 | switch (base.tag) { | 146 | switch (base.tag) { |
| 149 | .Elf => return @fieldParentPtr(Elf, "base", base).allocateDeclIndexes(decl), | 147 | .Elf => return @fieldParentPtr(Elf, "base", base).allocateDeclIndexes(decl), |
| 150 | .C => {}, | 148 | .C => {}, |
| 151 | else => unreachable, | | |
| 152 | } | 149 | } |
| 153 | } | 150 | } |
| 154 | | 151 | |
| ... | @@ -156,7 +153,6 @@ pub const File = struct { | ... | @@ -156,7 +153,6 @@ pub const File = struct { |
| 156 | switch (base.tag) { | 153 | switch (base.tag) { |
| 157 | .Elf => @fieldParentPtr(Elf, "base", base).deinit(), | 154 | .Elf => @fieldParentPtr(Elf, "base", base).deinit(), |
| 158 | .C => @fieldParentPtr(C, "base", base).deinit(), | 155 | .C => @fieldParentPtr(C, "base", base).deinit(), |
| 159 | else => unreachable, | | |
| 160 | } | 156 | } |
| 161 | } | 157 | } |
| 162 | | 158 | |
| ... | @@ -172,7 +168,6 @@ pub const File = struct { | ... | @@ -172,7 +168,6 @@ pub const File = struct { |
| 172 | parent.deinit(); | 168 | parent.deinit(); |
| 173 | parent.allocator.destroy(parent); | 169 | parent.allocator.destroy(parent); |
| 174 | }, | 170 | }, |
| 175 | else => unreachable, | | |
| 176 | } | 171 | } |
| 177 | } | 172 | } |
| 178 | | 173 | |
| ... | @@ -180,14 +175,13 @@ pub const File = struct { | ... | @@ -180,14 +175,13 @@ pub const File = struct { |
| 180 | try switch (base.tag) { | 175 | try switch (base.tag) { |
| 181 | .Elf => @fieldParentPtr(Elf, "base", base).flush(), | 176 | .Elf => @fieldParentPtr(Elf, "base", base).flush(), |
| 182 | .C => @fieldParentPtr(C, "base", base).flush(), | 177 | .C => @fieldParentPtr(C, "base", base).flush(), |
| 183 | else => unreachable, | | |
| 184 | }; | 178 | }; |
| 185 | } | 179 | } |
| 186 | | 180 | |
| 187 | pub fn freeDecl(base: *File, decl: *Module.Decl) void { | 181 | pub fn freeDecl(base: *File, decl: *Module.Decl) void { |
| 188 | switch (base.tag) { | 182 | switch (base.tag) { |
| 189 | .Elf => @fieldParentPtr(Elf, "base", base).freeDecl(decl), | 183 | .Elf => @fieldParentPtr(Elf, "base", base).freeDecl(decl), |
| 190 | else => unreachable, | 184 | .C => unreachable, |
| 191 | } | 185 | } |
| 192 | } | 186 | } |
| 193 | | 187 | |
| ... | @@ -195,7 +189,6 @@ pub const File = struct { | ... | @@ -195,7 +189,6 @@ pub const File = struct { |
| 195 | return switch (base.tag) { | 189 | return switch (base.tag) { |
| 196 | .Elf => @fieldParentPtr(Elf, "base", base).error_flags, | 190 | .Elf => @fieldParentPtr(Elf, "base", base).error_flags, |
| 197 | .C => return .{ .no_entry_point_found = false }, | 191 | .C => return .{ .no_entry_point_found = false }, |
| 198 | else => unreachable, | | |
| 199 | }; | 192 | }; |
| 200 | } | 193 | } |
| 201 | | 194 | |