0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00

llvm: refactor llvm.Object.emit to free llvm.Object before LLVM emit

This is a refactor which I've kind of been thinking of doing for a while
anyway. The LLVM backend, which emits LLVM bitcode, is now clearly
separated from the libllvm API calls, which process that bitcode into an
optimized IR/bitcode file, an assembly file, and/or an object file.

The main benefit of this change right now is that in non-incremental
compilations which use LLVM, we can now free the `llvm.Object` state
after generating bitcode and before calling into libllvm, which can
significantly decrease the peak RSS of such compilations.

Co-authored-by: Guy Fischman <gfischman@gmail.com>
This commit is contained in:
Matthew Lugg 2026-11-06 11:11:47 +00:00
commit ebce4c9f21
No known key found for this signature in database
GPG key ID: 3F5B7DCCBF4AF02E
9 changed files with 911 additions and 834 deletions