
Compiler Basics: LLVM - eatonphil
http://notes.eatonphil.com/compiler-basics-llvm.html
======
thisacctforreal
Is there any sense in compiling human-readable LLVM IR, like many compile-to-C
languages aim to do?

I imagine doing so wouldn't have much value, as nobody programs in the IR.

~~~
civility
He's implementing his own language, so it seems it would be useful for
debugging his own compiler. In other words, the IR he's generating is not
really for anybody else, it's for himself.

~~~
chc4
You can trivially dump your module to a file with the actual LLVM API using
`LLVMPrintModuleToFile`, even if the module is in the middle of being built.

It's easier to emit human-readable LLVM IR if you're just playing around (or
are using a language without good LLVM bindings), but it's strictly inferior
to using the actual API

