Compiler Pipeline
Source goes through a multi-stage pipeline. Each stage can be inspected independently with the CLI.
Stages
Source→Lexer→Parser→AST→Sema→Typed IR→IR Optimize→LLVM IR→Object→Binary
| Stage | CLI flag | Source dir |
|---|---|---|
| Lexer | — | src/lex/ |
| Parser + AST | — | src/parse/ |
| Semantic analysis | check | src/sema/ |
| Typed IR lowering | ir | src/ir/ |
| Typed IR optimization | ir | src/ir/ |
| LLVM IR | llvm-ir | src/backend/ |
| Object file | obj | via clang |
| Binary | build | via clang |
Directory layout
text
include/cnegative/ — public compiler headers
src/support/ — memory, source, diagnostics
src/lex/ — token and lexer logic
src/parse/ — AST and parser
src/sema/ — semantic checking
src/ir/ — typed IR lowering and optimization
src/backend/ — LLVM text backend and toolchain glue
src/cli/ — command entry point
src/asm/ — profiled hot-path assembly
cmake/ — build and test scripts
.github/workflows/ — CI workflowsCurrent compiler behavior
- parser recovery keeps reporting after common syntax mistakes
- typed IR runs before LLVM and now folds simple constant expressions
- object and binary emission still use the host
clangdriver