A compiler written in Rust for for BRIL (Big Red Intermediate Language). BRIL is a compiler IR whose canonical representation is JSON, making it extremely easy to parse.
- code block and control flow graph generation
- dead code elimination
turn --save simple.bril turn simple.bril
-
Install bril utilities found here.
turnt- a tool useful for running tests during compiler developmentbrilirs- a blazingly fast interpreter written in rust with support for floating-point operation and bit cast between char, int, float (double precision IEEE-754)brili2json- converts from text representation to the JSON representation
-
Build using
cargo build --release
Should pass the --help flag for more information. A couple points work highlighting:
-f|--file <FILE>specifies the source code filepath (rust_brilwill read from stdin otherwise)
--transform-print <FILE>will transform the bril program by adding print statements before everyjmpandbrinstruction (rust_brilwill print to stdout if no file is provided).--construct_cfg <FILE>will construct the code-block and write the control-flow graph to the filepath (rust_brilwill print to stdout if no file is provided).