[LLVMdev] code generation order

Hendrik Boom hendrik at topoi.pooq.com
Tue May 6 15:34:04 PDT 2008


On Tue, 06 May 2008 16:06:35 -0400, Gordon Henriksen wrote:

> 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

Great.  You probably have a very good idea how much easier this makes 
life.

-- hendrik





More information about the llvm-dev mailing list