diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-06-30 14:31:46 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-06-30 18:33:02 -0700 |
| commit | 152462e2e1513ca9d7db5c2d6a2a61b547c5151c (patch) | |
| tree | bb541574002b430386c403b1a45e7bc92b3c3c93 /src/Compilation.zig | |
| parent | 902dc8c721c762bc5d1b9786bad47b21da45042c (diff) | |
| download | zig-152462e2e1513ca9d7db5c2d6a2a61b547c5151c.tar.gz zig-152462e2e1513ca9d7db5c2d6a2a61b547c5151c.zip | |
stage2: object format affects whether LLVM can be used
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index c6c7a94b41..99b502dbd7 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1024,10 +1024,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { if (options.use_llvm) |explicit| break :blk explicit; - // If we are outputting .c code we must use Zig backend. - if (ofmt == .c) - break :blk false; - // If emitting to LLVM bitcode object format, must use LLVM backend. if (options.emit_llvm_ir != null or options.emit_llvm_bc != null) break :blk true; @@ -1042,7 +1038,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { break :blk true; // If LLVM does not support the target, then we can't use it. - if (!target_util.hasLlvmSupport(options.target)) + if (!target_util.hasLlvmSupport(options.target, ofmt)) break :blk false; // Prefer LLVM for release builds. |
