aleo2llvm
is a lightweight LLVM frontend compiling Aleo instructions to LLVM IR. It's built upon Aleo's snarkVM.
To build aleo2llvm
and install a command-line shotcut to it, run the following command:
cargo install --path .
You can directly call aleo2llvm
from command-line:
aleo2llvm <DIR_OF_ALEO_PROJ>
where <DIR_OF_ALEO_PROJ>
points to the root folder of your Aleo project.
For example:
aleo2llvm ./test/toy-examples/adder/
This outputs two files:
- A
*.ll
file of the transpiled LLVM IRs. - A
*.json
file of a summary that provides detailed metadata/info of the target Aleo project, e.g., types and mapping of variables. The summary file will be useful for downstream tasks that depend on LLVM IR, e.g., a static analyzer, symbolic execution, etc.
Alternatively, to do a quick testing without installation, just do:
cargo run <DIR_OF_ALEO_PROJ>
For example:
cargo run ./test/toy-examples/adder/