feat(windows): a Windows target for ludicc, and the compiler builds itself there
--target <triple> (default: the host, from OS=Windows_NT) selects the Windows runtime. emit_win.ludic defines the POSIX names the backend already calls over the UCRT and Win32 in IR, so rename replaces an existing file, ftell is 64-bit, and fopen is binary. Known folders follow %APPDATA% / %LOCALAPPDATA% / %TEMP%, and the driver speaks cmd.exe, writes .exe outputs and finds LLVM's clang. Verified: macOS three-stage fixpoint, ludic-dev test 135/135, and on Windows the Mac-emitted Windows IR and the Windows-built compiler's IR are identical through two generations. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
572e09b2b1
commit
5801005fca
15 changed files with 23292 additions and 21806 deletions
|
|
@ -88,8 +88,8 @@ function emit_intrinsic(name: pointer, e: Node) -> Val {
|
|||
g_term = true
|
||||
return val("0", "void")
|
||||
}
|
||||
if (name == "file_stderr") { return val(emit_bind("load ptr, ptr @__stderrp"), "pointer") }
|
||||
if (name == "file_stdout") { return val(emit_bind("load ptr, ptr @__stdoutp"), "pointer") }
|
||||
if (name == "file_stderr") { return val(emit_bind(stdstream_rhs(2)), "pointer") }
|
||||
if (name == "file_stdout") { return val(emit_bind(stdstream_rhs(1)), "pointer") }
|
||||
if (name == "run") {
|
||||
let c = arg_code(e, 0)
|
||||
return val(emit_bind(`call i32 @system(ptr {c})`), "int")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue