How snazzy-d/sdc works
SDC is a D compiler and toolchain project. Its main workflow takes D source through parsing and semantic analysis, then LLVM-backed code generation to a compiled result; the README also identifies JIT CTFE and a supporting runtime. The repository separately provides sdunit and sdfmt. Paths reflect the tree and README; source excerpts were limited, so internal call wiring is shown only at the documented subsystem level.
Main entry points: llvm LLVM backend · sdc.d Compiler driver · semantic Semantic analysis · dlexer.d D lexer
Components 17
Compiler Front End
- Compiler driver
src/driver/sdc.d - D lexer
src/source/dlexer.d - D parser
src/d/parser - D AST
src/d/ast - Semantic analysis
src/d/semantic - Compiler IR
src/d/ir
Code Generation
- LLVM backend
src/d/llvm - LLVM
import/llvm/c - JIT CTFE
src/d/llvm/evaluator.d
Runtime Support
- D runtime
sdlib - Garbage collector
sdlib/d/gc - Platform support
platform
Developer Tools
- Unit test runner
src/driver/sdunit.d - Code formatter
src/driver/sdfmt.d - Formatting engine
src/format
Other components
- D developer
- Compiled output
Connections 18
- D developer → Compiler driver: invokes
- Compiler driver → D lexer: reads source
- D lexer → D parser: tokens
- D parser → D AST: builds AST
- D AST → Semantic analysis: analyzed by
- Semantic analysis → Compiler IR: produces IR
- Compiler driver → LLVM backend: requests codegen
- LLVM backend → LLVM: uses API
- LLVM backend → Compiler IR: lowers IR
- LLVM backend → Compiled output: emits output
- Semantic analysis → JIT CTFE: uses for CTFE
- JIT CTFE → LLVM: uses API
- Compiled output → D runtime: requires support
- D runtime → Garbage collector: includes
- Garbage collector → Platform support: uses platform support
- D developer → Unit test runner: runs tests
- D developer → Code formatter: formats source
- Code formatter → Formatting engine: uses