[LLVMdev] Adding fields in a already built type? (2)
Stéphane Letz
letz at grame.fr
Tue Jun 15 23:28:20 PDT 2010
Le 15 juin 2010 à 23:05, Chris Lattner a écrit :
>
> On Jun 15, 2010, at 12:45 PM, Stéphane Letz wrote:
>>>>
>>>> Is that even possible?
>>>
>>> It would work, but sounds really inefficient. What are you really trying to do here?
>>>
>>> -Chris
>>
>>
>> inefficient : do you mean because all users of the refined type would have to be "notified" ?
>
> Yes.
Thanks for clarifying.
>
>> The reason is that our code generator generates a struct (progressively adding fields) and generates code that access this struct (that is : the fields that are already added). If we cannot create the struct progressively, then we have to define a pass to build the complete struct, then define a second pass to generate the code. If we can simply create the struct progressively at LLVM level, then it make our code simpler.
>
> LLVM doesn't support this sort of thing. Is two passes really that bad?
>
> -Chris
We'll do a two passes model.
Thanks again.
Stéphane Letz
More information about the llvm-dev
mailing list