| ... | @@ -1184,7 +1184,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1184,7 +1184,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1184 | | 1184 | |
| 1185 | // We put the `Compilation` itself in the arena. Freeing the arena will free the module. | 1185 | // We put the `Compilation` itself in the arena. Freeing the arena will free the module. |
| 1186 | // It's initialized later after we prepare the initialization options. | 1186 | // It's initialized later after we prepare the initialization options. |
| 1187 | const comp = try arena.create(Compilation); | | |
| 1188 | const root_name = try arena.dupeZ(u8, options.root_name); | 1187 | const root_name = try arena.dupeZ(u8, options.root_name); |
| 1189 | | 1188 | |
| 1190 | const use_llvm = options.config.use_llvm; | 1189 | const use_llvm = options.config.use_llvm; |
| ... | @@ -1280,7 +1279,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1280,7 +1279,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1280 | const sysroot = options.sysroot orelse libc_dirs.sysroot; | 1279 | const sysroot = options.sysroot orelse libc_dirs.sysroot; |
| 1281 | | 1280 | |
| 1282 | const include_compiler_rt = options.want_compiler_rt orelse | 1281 | const include_compiler_rt = options.want_compiler_rt orelse |
| 1283 | (!comp.skip_linker_dependencies and is_exe_or_dyn_lib); | 1282 | (!options.skip_linker_dependencies and is_exe_or_dyn_lib); |
| 1284 | | 1283 | |
| 1285 | if (include_compiler_rt and output_mode == .Obj) { | 1284 | if (include_compiler_rt and output_mode == .Obj) { |
| 1286 | // For objects, this mechanism relies on essentially `_ = @import("compiler-rt");` | 1285 | // For objects, this mechanism relies on essentially `_ = @import("compiler-rt");` |
| ... | @@ -1357,7 +1356,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1357,7 +1356,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1357 | cache.hash.add(options.config.link_libcpp); | 1356 | cache.hash.add(options.config.link_libcpp); |
| 1358 | cache.hash.add(options.config.link_libunwind); | 1357 | cache.hash.add(options.config.link_libunwind); |
| 1359 | cache.hash.add(output_mode); | 1358 | cache.hash.add(output_mode); |
| 1360 | cache_helpers.addDebugFormat(&cache.hash, comp.config.debug_format); | 1359 | cache_helpers.addDebugFormat(&cache.hash, options.config.debug_format); |
| 1361 | cache_helpers.addOptionalEmitLoc(&cache.hash, options.emit_bin); | 1360 | cache_helpers.addOptionalEmitLoc(&cache.hash, options.emit_bin); |
| 1362 | cache_helpers.addOptionalEmitLoc(&cache.hash, options.emit_implib); | 1361 | cache_helpers.addOptionalEmitLoc(&cache.hash, options.emit_implib); |
| 1363 | cache_helpers.addOptionalEmitLoc(&cache.hash, options.emit_docs); | 1362 | cache_helpers.addOptionalEmitLoc(&cache.hash, options.emit_docs); |
| ... | @@ -1365,6 +1364,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1365,6 +1364,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1365 | cache.hash.add(options.config.wasi_exec_model); | 1364 | cache.hash.add(options.config.wasi_exec_model); |
| 1366 | // TODO audit this and make sure everything is in it | 1365 | // TODO audit this and make sure everything is in it |
| 1367 | | 1366 | |
| | 1367 | const comp = try arena.create(Compilation); |
| 1368 | const opt_zcu: ?*Module = if (have_zcu) blk: { | 1368 | const opt_zcu: ?*Module = if (have_zcu) blk: { |
| 1369 | // Pre-open the directory handles for cached ZIR code so that it does not need | 1369 | // Pre-open the directory handles for cached ZIR code so that it does not need |
| 1370 | // to redundantly happen for each AstGen operation. | 1370 | // to redundantly happen for each AstGen operation. |