| ... | ... | @@ -387,36 +387,26 @@ pub fn generateSymbol( |
| 387 | 387 | } |
| 388 | 388 | }, |
| 389 | 389 | .aggregate => |aggregate| switch (mod.intern_pool.indexToKey(typed_value.ty.toIntern())) { |
| 390 | | .array_type => |array_type| { |
| 391 | | switch (aggregate.storage) { |
| 392 | | .bytes => |bytes| try code.appendSlice(bytes), |
| 393 | | .elems, .repeated_elem => { |
| 394 | | var index: u64 = 0; |
| 395 | | while (index < array_type.len) : (index += 1) { |
| 396 | | switch (try generateSymbol(bin_file, src_loc, .{ |
| 397 | | .ty = array_type.child.toType(), |
| 398 | | .val = switch (aggregate.storage) { |
| 399 | | .bytes => unreachable, |
| 400 | | .elems => |elems| elems[@intCast(usize, index)], |
| 401 | | .repeated_elem => |elem| elem, |
| 402 | | }.toValue(), |
| 403 | | }, code, debug_output, reloc_info)) { |
| 404 | | .ok => {}, |
| 405 | | .fail => |em| return .{ .fail = em }, |
| 406 | | } |
| 390 | .array_type => |array_type| switch (aggregate.storage) { |
| 391 | .bytes => |bytes| try code.appendSlice(bytes), |
| 392 | .elems, .repeated_elem => { |
| 393 | var index: u64 = 0; |
| 394 | var len_including_sentinel = |
| 395 | array_type.len + @boolToInt(array_type.sentinel != .none); |
| 396 | while (index < len_including_sentinel) : (index += 1) { |
| 397 | switch (try generateSymbol(bin_file, src_loc, .{ |
| 398 | .ty = array_type.child.toType(), |
| 399 | .val = switch (aggregate.storage) { |
| 400 | .bytes => unreachable, |
| 401 | .elems => |elems| elems[@intCast(usize, index)], |
| 402 | .repeated_elem => |elem| elem, |
| 403 | }.toValue(), |
| 404 | }, code, debug_output, reloc_info)) { |
| 405 | .ok => {}, |
| 406 | .fail => |em| return .{ .fail = em }, |
| 407 | 407 | } |
| 408 | | }, |
| 409 | | } |
| 410 | | |
| 411 | | if (array_type.sentinel != .none) { |
| 412 | | switch (try generateSymbol(bin_file, src_loc, .{ |
| 413 | | .ty = array_type.child.toType(), |
| 414 | | .val = array_type.sentinel.toValue(), |
| 415 | | }, code, debug_output, reloc_info)) { |
| 416 | | .ok => {}, |
| 417 | | .fail => |em| return .{ .fail = em }, |
| 418 | 408 | } |
| 419 | | } |
| 409 | }, |
| 420 | 410 | }, |
| 421 | 411 | .vector_type => |vector_type| { |
| 422 | 412 | switch (aggregate.storage) { |