| author | |
| committer | |
| log | 409c89ee2161c071ca713b5b69e8707b0e538aab |
| tree | 089cc4bb052a901d2d5381e45a745b1b0285c0ef |
| parent | 897c0b35a92dba851edd2ce49314468d3e1fcaff |
2 files changed, 8 insertions(+), 0 deletions(-)
src/Compilation.zig+3| ... | ... | @@ -2134,6 +2134,9 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, |
| 2134 | 2134 | comp.config.any_fuzz = any_fuzz; |
| 2135 | 2135 | |
| 2136 | 2136 | if (opt_zcu) |zcu| { |
| 2137 | // Finish initializing the `zcu` after the fields on `comp` have been initialized. | |
| 2138 | zcu.initAfterCompilation(); | |
| 2139 | ||
| 2137 | 2140 | // Populate `zcu.module_roots`. |
| 2138 | 2141 | const active = zcu.acquire(); |
| 2139 | 2142 | defer active.release(); |
src/Zcu.zig+5| ... | ... | @@ -2825,6 +2825,11 @@ pub const CompileError = error{ |
| 2825 | 2825 | |
| 2826 | 2826 | pub fn init(zcu: *Zcu, gpa: Allocator, io: Io, thread_count: usize) !void { |
| 2827 | 2827 | try zcu.intern_pool.init(gpa, io, thread_count); |
| 2828 | } | |
| 2829 | ||
| 2830 | /// It is valid to not call this function before `deinit` in error paths. | |
| 2831 | /// Requires the fields on `zcu.comp` to already be initialized. | |
| 2832 | pub fn initAfterCompilation(zcu: *Zcu) void { | |
| 2828 | 2833 | zcu.initTracyPlots(); |
| 2829 | 2834 | } |
| 2830 | 2835 |