Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 741 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 741 Bytes

mini-brain

A mini 🧠❗compiler using C++ and LLVM

Goals

  • Learn about LLVM and code generation (IR)
  • Learn basic compiler optimizations (what the LLVM functions are doing under the hood)
  • Get better at C++

Usage

Use generate the mini-brain executable

clang++ -g main.cc `llvm-config --cxxflags --ldflags --system-libs --libs core orcjit native` -O3 -o mini-brain

Running this program should generate the LLVM IR of your BF code in program.bf

To compile the IR to a binary, use

./mini-brain | clang -x ir -

Lastly, run ./a.out to see your program's result!