commit cbfa87cbea0274e1e88d6a61bba82a2099e19fd6 (tree)
parent ca34abbcde0edc7c32d515f8c4d6c39c529fdd09
Author: Matthew Lugg <mlugg@mlugg.co.uk>
Date: Mon, 10 Nov 2025 21:10:31 +0000
Merge pull request #25889 from mlugg/incremental-llvm-warn
compiler: warn when using -fincremental with LLVM backend
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/main.zig b/src/main.zig
@@ -155,11 +155,8 @@ pub fn log(
} else return;
}
- const prefix1 = comptime level.asText();
- const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): ";
-
- // Print the message to stderr, silently ignoring any errors
- std.debug.print(prefix1 ++ prefix2 ++ format ++ "\n", args);
+ // Otherwise, use the default implementation.
+ std.log.defaultLog(level, scope, format, args);
}
var debug_allocator: std.heap.DebugAllocator(.{
@@ -3363,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.