From e0e91d13cd43f265295e6dd9f98d49b098bd302c Mon Sep 17 00:00:00 2001 From: pentuppup Date: Tue, 23 Jun 2026 10:06:23 -0400 Subject: [PATCH] stop running LLVM codegen when we're not emitting a binary --- src/Compilation.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index 527e71a8994aaf430e080a6d436cdda7f0b8c4cf..2660f74e18f4a4a2efc962c0381141cd159e4a9c 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2447,7 +2447,14 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, }, } - if (use_llvm) { + if (use_llvm and + (comp.emit_bin != null or + comp.emit_asm != null or + comp.emit_llvm_ir != null or + comp.emit_llvm_bc != null or + comp.verbose_llvm_ir != null or + comp.verbose_llvm_bc != null)) + { if (opt_zcu) |zcu| { zcu.llvm_object = try LlvmObject.create(arena, zcu); } -- 2.54.0