A piece of C with LLVM ๐ฐ
https://github.com/huangsam/virtuc.git
A compiler for a subset of the C programming language, implemented in Rust. VirtuC supports lexical analysis, parsing, semantic analysis, code generation to LLVM IR, and execution via a custom virtual machine.
logos crate.nom parser combinator library.inkwell crate.int (64-bit), float (64-bit)if-else, for loopsEnsure you have Rust and LLVM installed. Then:
cargo build --release
Compile a C subset source file to an executable:
cargo run -- compile source.c -o output
Run the executable:
./output