| ... | ... | @@ -1374,6 +1374,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil |
| 1374 | 1374 | cache.hash.add(options.config.wasi_exec_model); |
| 1375 | 1375 | // TODO audit this and make sure everything is in it |
| 1376 | 1376 | |
| 1377 | const main_mod = options.main_mod orelse options.root_mod; |
| 1377 | 1378 | const comp = try arena.create(Compilation); |
| 1378 | 1379 | const opt_zcu: ?*Module = if (have_zcu) blk: { |
| 1379 | 1380 | // Pre-open the directory handles for cached ZIR code so that it does not need |
| ... | ... | @@ -1420,7 +1421,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil |
| 1420 | 1421 | zcu.* = .{ |
| 1421 | 1422 | .gpa = gpa, |
| 1422 | 1423 | .comp = comp, |
| 1423 | | .main_mod = options.main_mod orelse options.root_mod, |
| 1424 | .main_mod = main_mod, |
| 1424 | 1425 | .root_mod = options.root_mod, |
| 1425 | 1426 | .std_mod = std_mod, |
| 1426 | 1427 | .global_zir_cache = global_zir_cache, |
| ... | ... | @@ -1608,7 +1609,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil |
| 1608 | 1609 | // do want to namespace different source file names because they are |
| 1609 | 1610 | // likely different compilations and therefore this would be likely to |
| 1610 | 1611 | // cause cache hits. |
| 1611 | | try addModuleTableToCacheHash(gpa, arena, &hash, options.root_mod, .path_bytes); |
| 1612 | try addModuleTableToCacheHash(gpa, arena, &hash, main_mod, .path_bytes); |
| 1612 | 1613 | |
| 1613 | 1614 | // In the case of incremental cache mode, this `artifact_directory` |
| 1614 | 1615 | // is computed based on a hash of non-linker inputs, and it is where all |