`-S` stops the pipeline after IR emission and writes the `.ll` file
directly to the output path (default `<stem>.ll`). It implies `-c`
(no main required). Combined with `-o`, the IR goes to the specified
path.
Pipeline summary:
(none) → emit → opt → llc → cc → executable
-c → emit → opt → llc → <stem>.o
-S → emit → <stem>.ll
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements a full LLVM IR text emitter and three-step toolchain:
1. Emit LLVM IR (.ll) via alloca-based codegen (mem2reg-friendly)
2. `opt -O2` → optimised IR (override with FLUXC_OPT)
3. `llc -filetype=obj` → object file (override with FLUXC_LLC)
4. `cc` → link into executable (override with FLUXC_CC)
(step 4 skipped in -c mode)
Emitter supports all Flux types, operators, control flow (if/else,
while, loop, break, continue), structs, arrays, pointer operations,
function calls, string literals, and integer literal type inference
via UnboundInt → concrete-type coercion.
Also adds -o <file> CLI flag, exposes CheckResult from the checker
(sigma + phi tables reused by codegen), and updates main.rs to run
the full parse → check → codegen pipeline.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`fluxc -c <file>` compiles a source file without requiring a `main`
function, matching the convention of C compilers. Pass 4 (entry-point
validation) is skipped when `no_main` is set.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracts all argument-parsing and help logic into cli.rs:
- -h / --help: colored usage and options summary
- -V / --version: print version from Cargo.toml
- Unknown flags produce a styled error with a hint
- At least one file required; missing-file error is styled
- Multiple files accepted; exit code 1 if any file has parse errors