| ... | ... | @@ -1002,6 +1002,8 @@ pub const InitOptions = struct { |
| 1002 | 1002 | /// (Windows) PDB output path |
| 1003 | 1003 | pdb_out_path: ?[]const u8 = null, |
| 1004 | 1004 | error_limit: ?Module.ErrorInt = null, |
| 1005 | /// (SPIR-V) whether to generate a structured control flow graph or not |
| 1006 | want_structured_cfg: ?bool = null, |
| 1005 | 1007 | }; |
| 1006 | 1008 | |
| 1007 | 1009 | fn addModuleTableToCacheHash( |
| ... | ... | @@ -1447,6 +1449,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1447 | 1449 | }; |
| 1448 | 1450 | const formatted_panics = options.formatted_panics orelse (options.optimize_mode == .Debug); |
| 1449 | 1451 | |
| 1452 | const error_limit = options.error_limit orelse (std.math.maxInt(u16) - 1); |
| 1453 | |
| 1450 | 1454 | // We put everything into the cache hash that *cannot be modified |
| 1451 | 1455 | // during an incremental update*. For example, one cannot change the |
| 1452 | 1456 | // target between updates, but one can change source files, so the |
| ... | ... | @@ -1545,6 +1549,9 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1545 | 1549 | hash.add(options.skip_linker_dependencies); |
| 1546 | 1550 | hash.add(options.parent_compilation_link_libc); |
| 1547 | 1551 | hash.add(formatted_panics); |
| 1552 | hash.add(options.emit_h != null); |
| 1553 | hash.add(error_limit); |
| 1554 | hash.addOptional(options.want_structured_cfg); |
| 1548 | 1555 | |
| 1549 | 1556 | // In the case of incremental cache mode, this `zig_cache_artifact_directory` |
| 1550 | 1557 | // is computed based on a hash of non-linker inputs, and it is where all |
| ... | ... | @@ -1699,7 +1706,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1699 | 1706 | .local_zir_cache = local_zir_cache, |
| 1700 | 1707 | .emit_h = emit_h, |
| 1701 | 1708 | .tmp_hack_arena = std.heap.ArenaAllocator.init(gpa), |
| 1702 | | .error_limit = options.error_limit orelse (std.math.maxInt(u16) - 1), |
| 1709 | .error_limit = error_limit, |
| 1703 | 1710 | }; |
| 1704 | 1711 | try module.init(); |
| 1705 | 1712 | |
| ... | ... | @@ -1958,6 +1965,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1958 | 1965 | .force_undefined_symbols = options.force_undefined_symbols, |
| 1959 | 1966 | .pdb_source_path = options.pdb_source_path, |
| 1960 | 1967 | .pdb_out_path = options.pdb_out_path, |
| 1968 | .want_structured_cfg = options.want_structured_cfg, |
| 1961 | 1969 | }); |
| 1962 | 1970 | errdefer bin_file.destroy(); |
| 1963 | 1971 | comp.* = .{ |
| ... | ... | @@ -2732,6 +2740,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes |
| 2732 | 2740 | man.hash.add(comp.bin_file.options.valgrind); |
| 2733 | 2741 | man.hash.add(comp.bin_file.options.single_threaded); |
| 2734 | 2742 | man.hash.add(comp.bin_file.options.use_llvm); |
| 2743 | man.hash.add(comp.bin_file.options.use_lib_llvm); |
| 2735 | 2744 | man.hash.add(comp.bin_file.options.dll_export_fns); |
| 2736 | 2745 | man.hash.add(comp.bin_file.options.is_test); |
| 2737 | 2746 | man.hash.add(comp.test_evented_io); |
| ... | ... | @@ -2739,8 +2748,10 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes |
| 2739 | 2748 | man.hash.addOptionalBytes(comp.test_name_prefix); |
| 2740 | 2749 | man.hash.add(comp.bin_file.options.skip_linker_dependencies); |
| 2741 | 2750 | man.hash.add(comp.bin_file.options.parent_compilation_link_libc); |
| 2751 | man.hash.add(comp.formatted_panics); |
| 2742 | 2752 | man.hash.add(mod.emit_h != null); |
| 2743 | 2753 | man.hash.add(mod.error_limit); |
| 2754 | man.hash.addOptional(comp.bin_file.options.want_structured_cfg); |
| 2744 | 2755 | } |
| 2745 | 2756 | |
| 2746 | 2757 | try man.addOptionalFile(comp.bin_file.options.linker_script); |
| ... | ... | @@ -6823,6 +6834,7 @@ fn buildOutputFromZig( |
| 6823 | 6834 | .clang_passthrough_mode = comp.clang_passthrough_mode, |
| 6824 | 6835 | .skip_linker_dependencies = true, |
| 6825 | 6836 | .parent_compilation_link_libc = comp.bin_file.options.link_libc, |
| 6837 | .want_structured_cfg = comp.bin_file.options.want_structured_cfg, |
| 6826 | 6838 | }); |
| 6827 | 6839 | defer sub_compilation.destroy(); |
| 6828 | 6840 | |
| ... | ... | @@ -6903,6 +6915,7 @@ pub fn build_crt_file( |
| 6903 | 6915 | .clang_passthrough_mode = comp.clang_passthrough_mode, |
| 6904 | 6916 | .skip_linker_dependencies = true, |
| 6905 | 6917 | .parent_compilation_link_libc = comp.bin_file.options.link_libc, |
| 6918 | .want_structured_cfg = comp.bin_file.options.want_structured_cfg, |
| 6906 | 6919 | }); |
| 6907 | 6920 | defer sub_compilation.destroy(); |
| 6908 | 6921 | |