| ... | ... | @@ -2202,10 +2202,26 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void |
| 2202 | 2202 | return; |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | | // Flush takes care of -femit-bin, but we still have -femit-llvm-ir, -femit-llvm-bc, and |
| 2206 | | // -femit-asm to handle, in the case of C objects. |
| 2205 | // Flush below handles -femit-bin but there is still -femit-llvm-ir, |
| 2206 | // -femit-llvm-bc, and -femit-asm, in the case of C objects. |
| 2207 | 2207 | comp.emitOthers(); |
| 2208 | | try comp.flush(main_progress_node); |
| 2208 | |
| 2209 | { |
| 2210 | if (comp.bin_file) |lf| { |
| 2211 | // This is needed before reading the error flags. |
| 2212 | lf.flush(comp, main_progress_node) catch |err| switch (err) { |
| 2213 | error.FlushFailure => {}, // error reported through link_error_flags |
| 2214 | error.LLDReportedFailure => {}, // error reported via lockAndParseLldStderr |
| 2215 | else => |e| return e, |
| 2216 | }; |
| 2217 | comp.link_error_flags = lf.error_flags; |
| 2218 | } |
| 2219 | |
| 2220 | if (comp.module) |module| { |
| 2221 | try link.File.C.flushEmitH(module); |
| 2222 | } |
| 2223 | } |
| 2224 | |
| 2209 | 2225 | if (comp.totalErrorCount() != 0) return; |
| 2210 | 2226 | try maybeGenerateAutodocs(comp, main_progress_node); |
| 2211 | 2227 | |
| ... | ... | @@ -2323,22 +2339,6 @@ fn maybeGenerateAutodocs(comp: *Compilation, prog_node: *std.Progress.Node) !voi |
| 2323 | 2339 | } |
| 2324 | 2340 | } |
| 2325 | 2341 | |
| 2326 | | fn flush(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 2327 | | if (comp.bin_file) |lf| { |
| 2328 | | // This is needed before reading the error flags. |
| 2329 | | lf.flush(comp, prog_node) catch |err| switch (err) { |
| 2330 | | error.FlushFailure => {}, // error reported through link_error_flags |
| 2331 | | error.LLDReportedFailure => {}, // error reported via lockAndParseLldStderr |
| 2332 | | else => |e| return e, |
| 2333 | | }; |
| 2334 | | comp.link_error_flags = lf.error_flags; |
| 2335 | | } |
| 2336 | | |
| 2337 | | if (comp.module) |module| { |
| 2338 | | try link.File.C.flushEmitH(module); |
| 2339 | | } |
| 2340 | | } |
| 2341 | | |
| 2342 | 2342 | /// Communicate the output binary location to parent Compilations. |
| 2343 | 2343 | fn wholeCacheModeSetBinFilePath( |
| 2344 | 2344 | comp: *Compilation, |