gerate LLVM IR from an AST output from ANTLR

Hi,
I am a complete newbie to LLVM. I have an ANTLR parser, that outputs an AST. I want to comvert this AST to a LLVM IR, Can someone point me some relevant documentation/examples/ etc. on how to go about doing this?

TIA.

http://llvm.org/docs/tutorial/LangImpl3.html

-Eli

Thanks. So, in this tutorial, the LLVM IR generation code is embedded in the parser. I already have an AST, and if I dont want to touch the parser code, is there a way to generate the IR? or do I just walk the tree and generate the iR?

Hi Emily,

So, in this tutorial, the LLVM IR generation code is embedded in the parser.

It's embedded in the AST classes, but the parser itself doesn't know
anything about it. It's still a two-stage process: create AST, then
generate code from it.

It looks like ANTLR would allow you to change the AST to one with
similar abilities, but I can see why you might not want to.

or do I just walk the tree and generate the iR?

That seems like the only option to me. Nothing inside LLVM is going to
know about the intended semantics of your AST.

Cheers.

Tim.