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 the E2E compilation from C source code to [LLVM IR] for native execution. The IR artifact is then compiled and linked using clang to produce a final executable.
logos and nom.inkwell and links with system libraries via clang.extern declarations and #include <...> headers.int (64-bit), float (64-bit)if-else, for loopsEnsure you have Rust and LLVM installed. Then:
cargo install --path .
Once compiled, you can use the tool to compile C source files:
# Compile the source file
virtuc compile hello.c
# Run the generated executable
./hello.out