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

compiler: warn when using -fincremental with LLVM backend
This commit is contained in:
Matthew Lugg 2025-11-10 21:10:31 +00:00 committed by GitHub
commit cbfa87cbea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,11 +155,8 @@ pub fn log(
} else return; } else return;
} }
const prefix1 = comptime level.asText(); // Otherwise, use the default implementation.
const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): "; std.log.defaultLog(level, scope, format, args);
// Print the message to stderr, silently ignoring any errors
std.debug.print(prefix1 ++ prefix2 ++ format ++ "\n", args);
} }
var debug_allocator: std.heap.DebugAllocator(.{ var debug_allocator: std.heap.DebugAllocator(.{
@ -3363,6 +3360,10 @@ fn buildOutputType(
fatal("--debug-incremental requires -fincremental", .{}); 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: { const cache_mode: Compilation.CacheMode = b: {
// Once incremental compilation is the default, we'll want some smarter logic here, // 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. // considering things like the backend in use and whether there's a ZCU.