- Compile the compiler (instructions assume macOS with clang & CMake installed)
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=debug .. && cmake --build .
cd ..
- The compiler binary will now be
build/jcc
- Run the compiler with
-Teep
flag on your file, e.g./LOCATION_OF_JCC/build/jcc -Teep -Lasm mul.c
- the-Lasm
flag will print out the EEP assembly as well - It will output a file next to it suffixed by
.obj
which will be your EEP assembly - Rename this from
.c.obj
to.ram
and then you can import it into Issie
JCC is designed to be a pure C11 (no dependencies) C11 compiler.
No, it is text based
The current design consists of 3 stages:
- Frontend - Parser + Lexer
- Intermediate Representations and passes
- All code located in the
ir
folder - IR representation structs and helper methods are in
ir/ir.h
andir/ir.c
- Pretty-printing functionality is in
ir/prettyprint.h
andir/prettyprint.c
- This also includes graph-building functionality with graphviz
- IR building
- This stage converts the AST into an SSA IR form
- Code is
ir/build.h
andir/build.c
- Lowering
- This converts the IR into the platform-native form
- Currently only AArch64 is supported
- The code for lowering is in the aarch64 folder
aarch64/lower.c
contains the code that actually lowers the IR to assembly
- All code located in the
- Code Generation & Linking
- Emitting
- Currently only AArch64 is supported
- The code for emitting AArch64 is in the aarch64 folder
aarch64/isa.h
contains macros used for creating AArch64 instructionsaarch64/emitter.c
contains theaarch64_emitter
type used to actually emit these into memory
- Object file building
- Writes the object file to disk
- Currently only macOS Mach-O format supported
- Code is
macos/mach-o.h
andmacos/mach-o.c
- Linking
- Emitting