Skip to content

ccc-sp/ci0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci0 -- A Tiny Compiler Infrastructure

使用方式

建議在 Linux 下編譯本專案 (WSL 亦可,Windows 的 MinGW 不能跑 JIT)

$ sudo apt update
$ sudo apt install gcc-multilib

$ cd src

$ make clean
rm -f cc jit cc.i

$ make
gcc -E -DNO_INCLUDE cc.c -o cc.i
gcc -w -g -m32 cc.c -o cc
gcc -w -g -m32 jit.c -o jit -ldl

$ ./test.sh
hello, world
exit(13) cycle = 8
Compile ../test/hello.c success!
Output: ../test/hello.o
hello, world

sum(10)=55
exit(0) cycle = 303
Compile ../test/sum.c success!
Output: ../test/sum.o
sum(10)=55

f(7)=13
exit(1) cycle = 920
Compile ../test/fib.c success!
Output: ../test/fib.o
f(7)=13

f(7)=13
exit(1) cycle = 920
exit(1) cycle = 149880

Releases

No releases published

Packages

No packages published