[LLVMdev] code generation order

Gordon Henriksen gordonhenriksen at mac.com
Tue May 6 13:06:35 PDT 2008


On 2008-05-06, at 13:42, Hendrik Boom wrote:

> One more question. I hope you're not getting tired of me already.   
> Does
> generating LLVM code have to proceed in any particular order?
>
> Of course, if I am writing LLVM assembler by appending characters to  
> the
> end of a sequential file, I'd have to write everything in the order
> prescribed by the assembler syntax.
>
> But if I'm using the C interface to build an LLVM parse tree, does  
> that
> have to be in any particular time-order?  Can I, for example, define a
> few functions, start scattering code into them, decide I' like to  
> declare
> some more local variables in one of them, generate code for another,
> return to the first one and stick in a new basic block at its start,
> discover I should have declared some more global variables, and so  
> forth?
>
> That could be very convenient.


Yes, you can absolutely do this.

— Gordon





More information about the llvm-dev mailing list