Is there still a way to turn IR code into C++ API?

Hi, I’m learning to build a compiler for my toy language, and LLVM is totally a new thing for me. I feel hard to turn an AST to the C++ API code, and sometimes I have to write some C++ source code and turn it into IR code to find some clue, but most time this will not help, I don’t know what API I should use even if I got the IR code.

I search for a long time and find that there used to be a backend which can turn IR code back to C++ API code called “cpp”, but it is removed. And there used to be a online demo page which can do this, can it is disabled.

So is there still a way to turn IR code back to C++ API? If not, what the best way to learn how to represent AST by using C++ APIs?

This was removed because it bit-rotted. Nobody was maintaining it as IR changed, nor was it the best way to write IR.

You’ll probably want to walk through your AST and use an IRBuilder similar to the description in the Kaleidoscope tutorial.