Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

frontend to LLVM-based compiler

I am trying to develop a compiler based on the LLVM infrastructure. My language has a C like syntax and so I would like to leverage existing C compilers. Right now I am focusing on the frontend (lexical analysis, parsing), but I am confused as to which frontend would be the best approach. Clang, llvm-gcc or traditional flex/bison tools?

I am specially interested in the simplest solution which would allow me to generate LLVM IR code for later stages of my compiler.

like image 713
Ali J Avatar asked Nov 03 '22 20:11

Ali J


1 Answers

If you want to code everything by hand, then I recommand you the LLVM tutorial Kaleidoscope:

  • http://llvm.org/docs/tutorial/
like image 140
Phong Avatar answered Nov 15 '22 05:11

Phong