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