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); }