| ... | ... | @@ -336,7 +336,7 @@ pub const Object = struct { |
| 336 | 336 | bin_path: ?[:0]const u8, |
| 337 | 337 | asm_path: ?[:0]const u8, |
| 338 | 338 | post_ir_path: ?[:0]const u8, |
| 339 | | post_bc_path: ?[]const u8, |
| 339 | post_bc_path: ?[:0]const u8, |
| 340 | 340 | |
| 341 | 341 | is_debug: bool, |
| 342 | 342 | is_small: bool, |
| ... | ... | @@ -543,24 +543,13 @@ pub const Object = struct { |
| 543 | 543 | return diags.fail("failed to create '{s}': {t}", .{ path, err }); |
| 544 | 544 | defer file.close(io); |
| 545 | 545 | |
| 546 | | const ptr: [*]const u8 = @ptrCast(bitcode.ptr); |
| 547 | | file.writeStreamingAll(io, ptr[0..(bitcode.len * 4)]) catch |err| |
| 546 | file.writeStreamingAll(io, @ptrCast(bitcode)) catch |err| |
| 548 | 547 | return diags.fail("failed to write to '{s}': {t}", .{ path, err }); |
| 549 | 548 | } |
| 550 | 549 | |
| 551 | 550 | if (options.asm_path == null and options.bin_path == null and |
| 552 | 551 | options.post_ir_path == null and options.post_bc_path == null) return; |
| 553 | 552 | |
| 554 | | if (options.post_bc_path) |path| { |
| 555 | | var file = Io.Dir.cwd().createFile(io, path, .{}) catch |err| |
| 556 | | return diags.fail("failed to create '{s}': {t}", .{ path, err }); |
| 557 | | defer file.close(io); |
| 558 | | |
| 559 | | const ptr: [*]const u8 = @ptrCast(bitcode.ptr); |
| 560 | | file.writeStreamingAll(io, ptr[0..(bitcode.len * 4)]) catch |err| |
| 561 | | return diags.fail("failed to write to '{s}': {t}", .{ path, err }); |
| 562 | | } |
| 563 | | |
| 564 | 553 | if (!build_options.have_llvm or !comp.config.use_lib_llvm) { |
| 565 | 554 | return diags.fail("emitting without libllvm not implemented", .{}); |
| 566 | 555 | } |
| ... | ... | @@ -663,7 +652,7 @@ pub const Object = struct { |
| 663 | 652 | .asm_filename = null, |
| 664 | 653 | .bin_filename = if (options.bin_path) |x| x.ptr else null, |
| 665 | 654 | .llvm_ir_filename = if (options.post_ir_path) |x| x.ptr else null, |
| 666 | | .bitcode_filename = null, |
| 655 | .bitcode_filename = if (options.post_bc_path) |x| x.ptr else null, |
| 667 | 656 | |
| 668 | 657 | // `.coverage` value is only used when `.sancov` is enabled. |
| 669 | 658 | .sancov = options.fuzz or comp.config.san_cov_trace_pc_guard, |
| ... | ... | @@ -702,6 +691,7 @@ pub const Object = struct { |
| 702 | 691 | } |
| 703 | 692 | lowered_options.bin_filename = null; |
| 704 | 693 | lowered_options.llvm_ir_filename = null; |
| 694 | lowered_options.bitcode_filename = null; |
| 705 | 695 | } |
| 706 | 696 | |
| 707 | 697 | var time_report_c_str: [*:0]u8 = undefined; |