a work-in-progress compiler for a tiny subset of C language.
ccc is intended to be an optimizing compiler that produces code which is faster than gcc -O1 does, and compiles faster than that.
- support C11 features
- arithmetic operations
- pointer arithmetic
- arrays
- type checker
- support type qualifiers
- implicit type conversions
- initializers
- scalar
- array
- struct
- designated initializers
- a copy of struct
- local assignment
- argument
- return value
- preprocessor
- self-hosting
- complex declarators
- alignment specifiers
- float-point values
- optimizations
- linear scan register allocation
- naive mem2reg
- constant folding
- copy propagation
- dead code elimination
- tail call optimization
- loop unwinding
- misc
- improved error messages
- better support of debuggers
- support targets other than x86_64
To build ccc, run:
make
You'll see a compiled binary under ./build/
.
You can add DEBUG=0
to get an optimized build of ccc
.
To run tests, use test
target:
make test