authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-11-10 21:10:31+00:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-11-10 21:10:31+00:00
logcbfa87cbea0274e1e88d6a61bba82a2099e19fd6
tree5034ebbf9139d068091745b9135547cb4704a25f
parentca34abbcde0edc7c32d515f8c4d6c39c529fdd09
parent13993c4f62d8603aa5a25de70e2d111a01cbfaab
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25889 from mlugg/incremental-llvm-warn

compiler: warn when using -fincremental with LLVM backend

1 files changed, 6 insertions(+), 5 deletions(-)

src/main.zig+6-5
......@@ -155,11 +155,8 @@ pub fn log(
155155 } else return;
156156 }
157157
158 const prefix1 = comptime level.asText();
159 const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): ";
160
161 // Print the message to stderr, silently ignoring any errors
162 std.debug.print(prefix1 ++ prefix2 ++ format ++ "\n", args);
158 // Otherwise, use the default implementation.
159 std.log.defaultLog(level, scope, format, args);
163160}
164161
165162var debug_allocator: std.heap.DebugAllocator(.{
......@@ -3363,6 +3360,10 @@ fn buildOutputType(
33633360 fatal("--debug-incremental requires -fincremental", .{});
33643361 }
33653362
3363 if (incremental and create_module.resolved_options.use_llvm) {
3364 warn("-fincremental is currently unsupported by the LLVM backend; crashes or miscompilations are likely", .{});
3365 }
3366
33663367 const cache_mode: Compilation.CacheMode = b: {
33673368 // Once incremental compilation is the default, we'll want some smarter logic here,
33683369 // considering things like the backend in use and whether there's a ZCU.