| ... | ... | @@ -128,11 +128,11 @@ test_filter: ?[]const u8, |
| 128 | 128 | test_name_prefix: ?[]const u8, |
| 129 | 129 | test_evented_io: bool, |
| 130 | 130 | |
| 131 | | emit_h: ?EmitLoc, |
| 132 | 131 | emit_asm: ?EmitLoc, |
| 133 | 132 | emit_llvm_ir: ?EmitLoc, |
| 134 | 133 | emit_analysis: ?EmitLoc, |
| 135 | 134 | emit_docs: ?EmitLoc, |
| 135 | |
| 136 | 136 | c_header: ?c_link.Header, |
| 137 | 137 | |
| 138 | 138 | pub const InnerError = Module.InnerError; |
| ... | ... | @@ -973,8 +973,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 973 | 973 | .local_cache_directory = options.local_cache_directory, |
| 974 | 974 | .global_cache_directory = options.global_cache_directory, |
| 975 | 975 | .bin_file = bin_file, |
| 976 | | .emit_h = options.emit_h, |
| 977 | | .c_header = if (!use_llvm and options.emit_h != null) c_link.Header.init(gpa) else null, |
| 976 | .c_header = if (!use_llvm and options.emit_h != null) c_link.Header.init(gpa, options.emit_h) else null, |
| 978 | 977 | .emit_asm = options.emit_asm, |
| 979 | 978 | .emit_llvm_ir = options.emit_llvm_ir, |
| 980 | 979 | .emit_analysis = options.emit_analysis, |
| ... | ... | @@ -1289,7 +1288,7 @@ pub fn update(self: *Compilation) !void { |
| 1289 | 1288 | |
| 1290 | 1289 | // If we've chosen to emit a C header, flush the header to the disk. |
| 1291 | 1290 | if (self.c_header) |header| { |
| 1292 | | const header_path = self.emit_h.?; |
| 1291 | const header_path = header.emit_loc.?; |
| 1293 | 1292 | // If a directory has been provided, write the header there. Otherwise, just write it to the |
| 1294 | 1293 | // cache directory. |
| 1295 | 1294 | const header_dir = if (header_path.directory) |dir| |
| ... | ... | @@ -2952,7 +2951,7 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node |
| 2952 | 2951 | man.hash.add(comp.bin_file.options.function_sections); |
| 2953 | 2952 | man.hash.add(comp.bin_file.options.is_test); |
| 2954 | 2953 | man.hash.add(comp.bin_file.options.emit != null); |
| 2955 | | man.hash.addOptionalEmitLoc(comp.emit_h); |
| 2954 | man.hash.add(comp.c_header != null); |
| 2956 | 2955 | man.hash.addOptionalEmitLoc(comp.emit_asm); |
| 2957 | 2956 | man.hash.addOptionalEmitLoc(comp.emit_llvm_ir); |
| 2958 | 2957 | man.hash.addOptionalEmitLoc(comp.emit_analysis); |
| ... | ... | @@ -3051,10 +3050,10 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node |
| 3051 | 3050 | }); |
| 3052 | 3051 | break :blk try directory.join(arena, &[_][]const u8{bin_basename}); |
| 3053 | 3052 | } else ""; |
| 3054 | | if (comp.emit_h != null) { |
| 3053 | if (comp.c_header != null) { |
| 3055 | 3054 | log.warn("-femit-h is not available in the stage1 backend; no .h file will be produced", .{}); |
| 3056 | 3055 | } |
| 3057 | | const emit_h_path = try stage1LocPath(arena, comp.emit_h, directory); |
| 3056 | const emit_h_path = try stage1LocPath(arena, if (comp.c_header) |header| header.emit_loc else null, directory); |
| 3058 | 3057 | const emit_asm_path = try stage1LocPath(arena, comp.emit_asm, directory); |
| 3059 | 3058 | const emit_llvm_ir_path = try stage1LocPath(arena, comp.emit_llvm_ir, directory); |
| 3060 | 3059 | const emit_analysis_path = try stage1LocPath(arena, comp.emit_analysis, directory); |