aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorMatthew Lugg <mlugg@mlugg.co.uk>2025-11-10 12:56:35 +0000
committerMatthew Lugg <mlugg@mlugg.co.uk>2025-11-10 12:56:35 +0000
commit13993c4f62d8603aa5a25de70e2d111a01cbfaab (patch)
treef6148a9c44f6acb600086675a59a9704c6d99230 /src/main.zig
parent6d280dc1b0779209b4790da9e939d8254d11348a (diff)
downloadzig-13993c4f62d8603aa5a25de70e2d111a01cbfaab.tar.gz
zig-13993c4f62d8603aa5a25de70e2d111a01cbfaab.zip
compiler: warn when using -fincremental with LLVM backend
This configuration hasn't had much work put into it yet, so is all but guaranteed to miscompile or crash. Since users are starting to try out `-fincremental`, and LLVM is still the default backend in many cases, it's worth having this warning to avoid bug reports like https://github.com/ziglang/zig/issues/25873.
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index 0f2a0a225c..52bb4b9c4e 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -3360,6 +3360,10 @@ fn buildOutputType(
fatal("--debug-incremental requires -fincremental", .{});
}
+ if (incremental and create_module.resolved_options.use_llvm) {
+ warn("-fincremental is currently unsupported by the LLVM backend; crashes or miscompilations are likely", .{});
+ }
+
const cache_mode: Compilation.CacheMode = b: {
// Once incremental compilation is the default, we'll want some smarter logic here,
// considering things like the backend in use and whether there's a ZCU.