stage2: Air and Liveness are passed ephemerally

to the link infrastructure, instead of being stored with Module.Fn. This
moves towards a strategy to make more efficient use of memory by not
storing Air or Liveness data in the Fn struct, but computing it on
demand, immediately sending it to the backend, and then immediately
freeing it.

Backends which want to defer codegen until flush() such as SPIR-V
must move the Air/Liveness data upon `updateFunc` being called and keep
track of that data in the backend implementation itself.
This commit is contained in:
Andrew Kelley
2021-07-12 19:51:31 -07:00
parent 0ffc6b5cc3
commit 0f38f68696
18 changed files with 1018 additions and 708 deletions

View File

@@ -769,11 +769,6 @@ pub const Fn = struct {
success,
};
/// For debugging purposes.
pub fn dump(func: *Fn, mod: Module) void {
ir.dumpFn(mod, func);
}
pub fn deinit(func: *Fn, gpa: *Allocator) void {
if (func.getInferredErrorSet()) |map| {
map.deinit(gpa);