[LLVMdev] code generation order

Hendrik Boom hendrik at topoi.pooq.com
Tue May 6 10:42:29 PDT 2008


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.

-- hendrik




More information about the llvm-dev mailing list