aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation/Config.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-06-04 01:42:40 -0400
committerAndrew Kelley <andrew@ziglang.org>2025-06-06 23:42:14 -0700
commit5986bdf868a58cdef2adf58ff27b6526eafd99fe (patch)
tree5310161f00ef5adaa1baf62bac4d4ba646f26ab2 /src/Compilation/Config.zig
parente96d86064eb81977f254fa8f36481b7d150cb3b6 (diff)
downloadzig-5986bdf868a58cdef2adf58ff27b6526eafd99fe.tar.gz
zig-5986bdf868a58cdef2adf58ff27b6526eafd99fe.zip
Compilation: enable the x86_64 backend by default for debug builds
Closes #22257
Diffstat (limited to 'src/Compilation/Config.zig')
-rw-r--r--src/Compilation/Config.zig14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig
index 49b5328a3a..b6d16d57ec 100644
--- a/src/Compilation/Config.zig
+++ b/src/Compilation/Config.zig
@@ -195,10 +195,7 @@ pub fn resolve(options: Options) ResolveError!Config {
// Note that using the LLVM backend does not necessarily mean using LLVM libraries.
// For example, Zig can emit .bc and .ll files directly, and this is still considered
// using "the LLVM backend".
- const use_llvm = b: {
- // If we have no zig code to compile, no need for LLVM.
- if (!options.have_zcu) break :b false;
-
+ const can_use_llvm = b: {
// If emitting to LLVM bitcode object format, must use LLVM backend.
if (options.emit_llvm_ir or options.emit_llvm_bc) {
if (options.use_llvm == false)
@@ -237,6 +234,13 @@ pub fn resolve(options: Options) ResolveError!Config {
break :b !target_util.selfHostedBackendIsAsRobustAsLlvm(target);
};
+ const use_llvm = b: {
+ // If we have no zig code to compile, no need for LLVM.
+ if (!options.have_zcu) break :b false;
+
+ break :b can_use_llvm;
+ };
+
if (options.emit_bin and options.have_zcu) {
if (!use_lib_llvm and use_llvm) {
// Explicit request to use LLVM to produce an object file, but without
@@ -273,7 +277,7 @@ pub fn resolve(options: Options) ResolveError!Config {
}
if (options.use_lld) |x| break :b x;
- break :b true;
+ break :b can_use_llvm;
};
// Make a decision on whether to use Clang or Aro for translate-c and compiling C files.